@uipath/cli 1.197.0-preview.66 → 1.197.0-preview.68

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
@@ -45866,7 +45866,7 @@ var init_package = __esm(() => {
45866
45866
  package_default = {
45867
45867
  name: "@uipath/cli",
45868
45868
  license: "MIT",
45869
- version: "1.197.0-preview.66",
45869
+ version: "1.197.0-preview.68",
45870
45870
  description: "Cross platform CLI for UiPath",
45871
45871
  repository: {
45872
45872
  type: "git",
@@ -108164,31 +108164,28 @@ var init_contentStore = __esm(() => {
108164
108164
 
108165
108165
  // src/commands/skills/agents/claude.ts
108166
108166
  import { spawn as spawn2 } from "node:child_process";
108167
+ function samePath(a, b) {
108168
+ const norm = (p) => {
108169
+ const forward = p.replaceAll("\\", "/").replace(/\/+$/, "");
108170
+ return process.platform === "win32" ? forward.toLowerCase() : forward;
108171
+ };
108172
+ return norm(a) === norm(b);
108173
+ }
108167
108174
  function claudeConfigDir() {
108168
108175
  const fs7 = getFileSystem();
108169
108176
  const override = fs7.env.getenv("CLAUDE_CONFIG_DIR");
108170
108177
  return override?.trim() ? override : fs7.path.join(fs7.env.homedir(), ".claude");
108171
108178
  }
108172
- function withGitLongPaths(env) {
108173
- const existing = Number.parseInt(env.GIT_CONFIG_COUNT ?? "", 10);
108174
- const count = Number.isInteger(existing) && existing >= 0 ? existing : 0;
108175
- return {
108176
- ...env,
108177
- GIT_CONFIG_COUNT: String(count + 1),
108178
- [`GIT_CONFIG_KEY_${count}`]: "core.longpaths",
108179
- [`GIT_CONFIG_VALUE_${count}`]: "true"
108180
- };
108179
+ function quoteForWinShell(arg) {
108180
+ return /\s/.test(arg) ? `"${arg}"` : arg;
108181
108181
  }
108182
108182
  function runClaude(args) {
108183
108183
  return new Promise((resolve2, reject) => {
108184
- const env = withGitLongPaths(process.env);
108185
- const proc = process.platform === "win32" ? spawn2(["claude", ...args].join(" "), [], {
108184
+ const proc = process.platform === "win32" ? spawn2(["claude", ...args.map(quoteForWinShell)].join(" "), [], {
108186
108185
  stdio: ["inherit", "pipe", "pipe"],
108187
- shell: true,
108188
- env
108186
+ shell: true
108189
108187
  }) : spawn2("claude", [...args], {
108190
- stdio: ["inherit", "pipe", "pipe"],
108191
- env
108188
+ stdio: ["inherit", "pipe", "pipe"]
108192
108189
  });
108193
108190
  let stderr = "";
108194
108191
  proc.stdout?.on("data", (d) => {
@@ -108236,42 +108233,7 @@ async function removeLegacySkillCopies(storePath, rootDir) {
108236
108233
  }
108237
108234
  }
108238
108235
  }
108239
- async function enableMarketplaceAutoUpdate() {
108240
- const fs7 = getFileSystem();
108241
- const settingsPath = fs7.path.join(claudeConfigDir(), "settings.json");
108242
- let raw = "{}";
108243
- if (await fs7.exists(settingsPath)) {
108244
- const [readErr, value] = await catchError(fs7.readFile(settingsPath, { encoding: "utf-8" }));
108245
- if (readErr) {
108246
- logger.warn(` claude: could not read ${settingsPath} — skipping autoUpdate flag: ${readErr.message}`);
108247
- return;
108248
- }
108249
- raw = value;
108250
- }
108251
- const [parseErr, parsed] = catchError(() => JSON.parse(raw || "{}"));
108252
- if (parseErr || !parsed) {
108253
- logger.warn(` claude: could not parse ${settingsPath} — skipping autoUpdate flag`);
108254
- return;
108255
- }
108256
- parsed.extraKnownMarketplaces ??= {};
108257
- const mks = parsed.extraKnownMarketplaces;
108258
- mks[MARKETPLACE_NAME] ??= {};
108259
- const entry = mks[MARKETPLACE_NAME];
108260
- const desiredSource = { source: "git", url: MARKETPLACE_URL };
108261
- const sourceMatches = JSON.stringify(entry.source) === JSON.stringify(desiredSource);
108262
- if (entry.autoUpdate === true && sourceMatches)
108263
- return;
108264
- entry.autoUpdate = true;
108265
- entry.source = desiredSource;
108266
- const [writeErr] = await catchError(fs7.writeFile(settingsPath, `${JSON.stringify(parsed, null, 2)}
108267
- `));
108268
- if (writeErr) {
108269
- logger.warn(` claude: could not write ${settingsPath} — autoUpdate flag not set: ${writeErr.message}`);
108270
- return;
108271
- }
108272
- logger.info(` claude: enabled auto-update for marketplace ${MARKETPLACE_NAME}`);
108273
- }
108274
- async function isHttpsMarketplaceRegistered() {
108236
+ async function isDirectoryMarketplaceRegistered(storePath) {
108275
108237
  const fs7 = getFileSystem();
108276
108238
  const registryPath = fs7.path.join(claudeConfigDir(), "plugins", "known_marketplaces.json");
108277
108239
  if (!await fs7.exists(registryPath))
@@ -108283,21 +108245,53 @@ async function isHttpsMarketplaceRegistered() {
108283
108245
  if (parseErr || !parsed)
108284
108246
  return false;
108285
108247
  const source = parsed[MARKETPLACE_NAME]?.source;
108286
- return source?.source === "git" && source?.url === MARKETPLACE_URL;
108248
+ return source?.source === "directory" && !!source.path && samePath(source.path, storePath);
108287
108249
  }
108288
- async function ensureHttpsMarketplace() {
108289
- if (await isHttpsMarketplaceRegistered())
108250
+ function marketplacesCacheDir() {
108251
+ const fs7 = getFileSystem();
108252
+ return fs7.path.join(claudeConfigDir(), "plugins", "marketplaces");
108253
+ }
108254
+ async function removeStaleMarketplaceCache() {
108255
+ const fs7 = getFileSystem();
108256
+ const cacheDir = marketplacesCacheDir();
108257
+ const [readErr, entries] = await catchError(fs7.readdir(cacheDir));
108258
+ if (readErr || !entries)
108290
108259
  return;
108291
- await runClaude(["plugin", "marketplace", "add", MARKETPLACE_URL]);
108260
+ const stale = entries.filter((name) => name === MARKETPLACE_NAME || name.startsWith("temp_"));
108261
+ for (const name of stale) {
108262
+ const target = fs7.path.join(cacheDir, name);
108263
+ const [rmErr] = await catchError(fs7.rm(target));
108264
+ if (rmErr) {
108265
+ logger.warn(` claude: could not remove stale marketplace cache ${target}: ${rmErr.message}`);
108266
+ }
108267
+ }
108292
108268
  }
108293
- var MARKETPLACE_REPO = "UiPath/skills", MARKETPLACE_URL, MARKETPLACE_NAME = "uipath-marketplace", PLUGIN_NAME = "uipath", PLUGIN_REF, def2;
108269
+ async function ensureDirectoryMarketplace(storePath) {
108270
+ if (await isDirectoryMarketplaceRegistered(storePath))
108271
+ return;
108272
+ const addArgs = ["plugin", "marketplace", "add", storePath];
108273
+ const [addErr] = await catchError(runClaude(addArgs));
108274
+ if (!addErr)
108275
+ return;
108276
+ if (!FINALIZE_CACHE_ERROR.test(addErr.message))
108277
+ throw addErr;
108278
+ logger.warn(" claude: marketplace add hit a stale cache — clearing it and retrying once");
108279
+ await removeStaleMarketplaceCache();
108280
+ const [retryErr] = await catchError(runClaude(addArgs));
108281
+ if (!retryErr)
108282
+ return;
108283
+ throw Object.assign(retryErr, {
108284
+ instructions: `Close all running Claude Code sessions, delete ${getFileSystem().path.join(marketplacesCacheDir(), MARKETPLACE_NAME)} if it still exists, then re-run this command. ` + "If it keeps failing, an antivirus or another process is locking the directory."
108285
+ });
108286
+ }
108287
+ var MARKETPLACE_NAME = "uipath-marketplace", PLUGIN_NAME = "uipath", PLUGIN_REF, FINALIZE_CACHE_ERROR, def2;
108294
108288
  var init_claude = __esm(() => {
108295
108289
  init_src2();
108296
108290
  init_src();
108297
108291
  init_contentStore();
108298
108292
  init_detect();
108299
- MARKETPLACE_URL = `https://github.com/${MARKETPLACE_REPO}.git`;
108300
108293
  PLUGIN_REF = `${PLUGIN_NAME}@${MARKETPLACE_NAME}`;
108294
+ FINALIZE_CACHE_ERROR = /Failed to finalize marketplace cache/i;
108301
108295
  def2 = {
108302
108296
  localSubdir: [".claude", "skills"],
108303
108297
  globalOnly: true,
@@ -108305,17 +108299,15 @@ var init_claude = __esm(() => {
108305
108299
  detect: () => verifiedCommandOnPath(["claude"], /Claude Code/i),
108306
108300
  install: async ({ storePath, rootDir }) => {
108307
108301
  await removeLegacySkillCopies(storePath, rootDir);
108308
- await ensureHttpsMarketplace();
108302
+ await ensureDirectoryMarketplace(storePath);
108309
108303
  await runClaude(["plugin", "install", PLUGIN_REF]);
108310
- await enableMarketplaceAutoUpdate();
108311
108304
  logger.info(` claude: installed plugin ${PLUGIN_REF}`);
108312
108305
  },
108313
108306
  update: async ({ storePath, rootDir }) => {
108314
108307
  await removeLegacySkillCopies(storePath, rootDir);
108315
- await ensureHttpsMarketplace();
108308
+ await ensureDirectoryMarketplace(storePath);
108316
108309
  await runClaude(["plugin", "marketplace", "update", MARKETPLACE_NAME]);
108317
108310
  await runClaude(["plugin", "update", PLUGIN_REF]);
108318
- await enableMarketplaceAutoUpdate();
108319
108311
  logger.info(` claude: updated plugin ${PLUGIN_REF}`);
108320
108312
  },
108321
108313
  uninstall: async ({ storePath, rootDir }) => {
@@ -109029,7 +109021,9 @@ async function runOneAgent(agent, operation, resolved) {
109029
109021
  if (customHook) {
109030
109022
  const [installError] = await catchError(customHook({ skills: selectedSkills, rootDir, storePath, isLocal }));
109031
109023
  if (installError) {
109032
- return new Error(`Failed to ${operation} skills for ${agent}: ${installError.message}`);
109024
+ return Object.assign(new Error(`Failed to ${operation} skills for ${agent}: ${installError.message}`), {
109025
+ instructions: installError.instructions
109026
+ });
109033
109027
  }
109034
109028
  return selectedSkills.map((s) => `${agent}:${s.name}`);
109035
109029
  }
@@ -109081,7 +109075,8 @@ async function runAgentInstalls(resolved, operation = "install") {
109081
109075
  if (failures.length > 0) {
109082
109076
  const summary = failures.map((f) => f.error.message).join("; ");
109083
109077
  const succeededNote = succeededAgents.length > 0 ? ` (${succeededAgents.join(", ")} succeeded)` : "";
109084
- throw new SkillsError(`${summary}${succeededNote}`, "Check that each failed agent's CLI is installed and on PATH. Re-run for the failed agents only — the manifest already reflects the agents that succeeded.");
109078
+ const specific = failures.map((f) => f.error.instructions).filter((i) => !!i);
109079
+ throw new SkillsError(`${summary}${succeededNote}`, specific.length > 0 ? specific.join(" ") : "Check that each failed agent's CLI is installed and on PATH. Re-run for the failed agents only — the manifest already reflects the agents that succeeded.");
109085
109080
  }
109086
109081
  return installed;
109087
109082
  }
@@ -115361,4 +115356,4 @@ export {
115361
115356
  ready
115362
115357
  };
115363
115358
 
115364
- //# debugId=08E496A669D4128264756E2164756E21
115359
+ //# debugId=5C55ACDD710EB6FC64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/cli",
3
3
  "license": "MIT",
4
- "version": "1.197.0-preview.66",
4
+ "version": "1.197.0-preview.68",
5
5
  "description": "Cross platform CLI for UiPath",
6
6
  "repository": {
7
7
  "type": "git",
@@ -34,5 +34,5 @@
34
34
  "mihaigirleanu",
35
35
  "vlad-uipath"
36
36
  ],
37
- "gitHead": "386b0837882b19062bf744c74949cdf9c5e48dea"
37
+ "gitHead": "56f68b263cec4ea1f2a39d738bd99ecf52f88fea"
38
38
  }