@uipath/cli 0.1.21 → 0.2.0

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 +411 -502
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -22797,20 +22797,29 @@ var require_utils10 = __commonJS((exports) => {
22797
22797
  }
22798
22798
  exports.getKeyPairs = getKeyPairs;
22799
22799
  function parsePairKeyValue(entry) {
22800
- const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR);
22801
- if (valueProps.length <= 0)
22802
- return;
22803
- const keyPairPart = valueProps.shift();
22804
- if (!keyPairPart)
22800
+ if (!entry)
22805
22801
  return;
22802
+ const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR);
22803
+ const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex);
22806
22804
  const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR);
22807
22805
  if (separatorIndex <= 0)
22808
22806
  return;
22809
- const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim());
22810
- const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim());
22807
+ const rawKey = keyPairPart.substring(0, separatorIndex).trim();
22808
+ const rawValue = keyPairPart.substring(separatorIndex + 1).trim();
22809
+ if (!rawKey || !rawValue)
22810
+ return;
22811
+ let key;
22812
+ let value;
22813
+ try {
22814
+ key = decodeURIComponent(rawKey);
22815
+ value = decodeURIComponent(rawValue);
22816
+ } catch {
22817
+ return;
22818
+ }
22811
22819
  let metadata;
22812
- if (valueProps.length > 0) {
22813
- metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR));
22820
+ if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) {
22821
+ const metadataString = entry.substring(metadataSeparatorIndex + 1);
22822
+ metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString);
22814
22823
  }
22815
22824
  return { key, value, metadata };
22816
22825
  }
@@ -22916,11 +22925,15 @@ var require_attributes2 = __commonJS((exports) => {
22916
22925
  if (typeof attributes !== "object" || attributes == null) {
22917
22926
  return out;
22918
22927
  }
22919
- for (const [key, val] of Object.entries(attributes)) {
22928
+ for (const key in attributes) {
22929
+ if (!Object.prototype.hasOwnProperty.call(attributes, key)) {
22930
+ continue;
22931
+ }
22920
22932
  if (!isAttributeKey(key)) {
22921
22933
  api_1.diag.warn(`Invalid attribute key: ${key}`);
22922
22934
  continue;
22923
22935
  }
22936
+ const val = attributes[key];
22924
22937
  if (!isAttributeValue(val)) {
22925
22938
  api_1.diag.warn(`Invalid attribute value set for key: ${key}`);
22926
22939
  continue;
@@ -22935,7 +22948,7 @@ var require_attributes2 = __commonJS((exports) => {
22935
22948
  }
22936
22949
  exports.sanitizeAttributes = sanitizeAttributes;
22937
22950
  function isAttributeKey(key) {
22938
- return typeof key === "string" && key.length > 0;
22951
+ return typeof key === "string" && key !== "";
22939
22952
  }
22940
22953
  exports.isAttributeKey = isAttributeKey;
22941
22954
  function isAttributeValue(val) {
@@ -22945,7 +22958,7 @@ var require_attributes2 = __commonJS((exports) => {
22945
22958
  if (Array.isArray(val)) {
22946
22959
  return isHomogeneousAttributeValueArray(val);
22947
22960
  }
22948
- return isValidPrimitiveAttributeValue(val);
22961
+ return isValidPrimitiveAttributeValueType(typeof val);
22949
22962
  }
22950
22963
  exports.isAttributeValue = isAttributeValue;
22951
22964
  function isHomogeneousAttributeValueArray(arr) {
@@ -22953,22 +22966,23 @@ var require_attributes2 = __commonJS((exports) => {
22953
22966
  for (const element of arr) {
22954
22967
  if (element == null)
22955
22968
  continue;
22969
+ const elementType = typeof element;
22970
+ if (elementType === type2) {
22971
+ continue;
22972
+ }
22956
22973
  if (!type2) {
22957
- if (isValidPrimitiveAttributeValue(element)) {
22958
- type2 = typeof element;
22974
+ if (isValidPrimitiveAttributeValueType(elementType)) {
22975
+ type2 = elementType;
22959
22976
  continue;
22960
22977
  }
22961
22978
  return false;
22962
22979
  }
22963
- if (typeof element === type2) {
22964
- continue;
22965
- }
22966
22980
  return false;
22967
22981
  }
22968
22982
  return true;
22969
22983
  }
22970
- function isValidPrimitiveAttributeValue(val) {
22971
- switch (typeof val) {
22984
+ function isValidPrimitiveAttributeValueType(valType) {
22985
+ switch (valType) {
22972
22986
  case "number":
22973
22987
  case "boolean":
22974
22988
  case "string":
@@ -23080,26 +23094,18 @@ var require_environment3 = __commonJS((exports) => {
23080
23094
  exports.getStringListFromEnv = getStringListFromEnv;
23081
23095
  });
23082
23096
 
23083
- // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js
23097
+ // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/common/globalThis.js
23084
23098
  var require_globalThis2 = __commonJS((exports) => {
23085
23099
  Object.defineProperty(exports, "__esModule", { value: true });
23086
23100
  exports._globalThis = undefined;
23087
- exports._globalThis = typeof globalThis === "object" ? globalThis : global;
23088
- });
23089
-
23090
- // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/platform/node/performance.js
23091
- var require_performance2 = __commonJS((exports) => {
23092
- Object.defineProperty(exports, "__esModule", { value: true });
23093
- exports.otperformance = undefined;
23094
- var perf_hooks_1 = __require("perf_hooks");
23095
- exports.otperformance = perf_hooks_1.performance;
23101
+ exports._globalThis = globalThis;
23096
23102
  });
23097
23103
 
23098
23104
  // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/version.js
23099
23105
  var require_version3 = __commonJS((exports) => {
23100
23106
  Object.defineProperty(exports, "__esModule", { value: true });
23101
23107
  exports.VERSION = undefined;
23102
- exports.VERSION = "2.1.0";
23108
+ exports.VERSION = "2.6.1";
23103
23109
  });
23104
23110
 
23105
23111
  // ../../node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js
@@ -24672,20 +24678,10 @@ var require_sdk_info2 = __commonJS((exports) => {
24672
24678
  };
24673
24679
  });
24674
24680
 
24675
- // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js
24676
- var require_timer_util2 = __commonJS((exports) => {
24677
- Object.defineProperty(exports, "__esModule", { value: true });
24678
- exports.unrefTimer = undefined;
24679
- function unrefTimer(timer) {
24680
- timer.unref();
24681
- }
24682
- exports.unrefTimer = unrefTimer;
24683
- });
24684
-
24685
24681
  // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/platform/node/index.js
24686
24682
  var require_node7 = __commonJS((exports) => {
24687
24683
  Object.defineProperty(exports, "__esModule", { value: true });
24688
- exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined;
24684
+ exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined;
24689
24685
  var environment_1 = require_environment3();
24690
24686
  Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() {
24691
24687
  return environment_1.getStringFromEnv;
@@ -24703,24 +24699,17 @@ var require_node7 = __commonJS((exports) => {
24703
24699
  Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() {
24704
24700
  return globalThis_1._globalThis;
24705
24701
  } });
24706
- var performance_1 = require_performance2();
24707
- Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() {
24708
- return performance_1.otperformance;
24709
- } });
24710
24702
  var sdk_info_1 = require_sdk_info2();
24711
24703
  Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() {
24712
24704
  return sdk_info_1.SDK_INFO;
24713
24705
  } });
24714
- var timer_util_1 = require_timer_util2();
24715
- Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() {
24716
- return timer_util_1.unrefTimer;
24717
- } });
24706
+ exports.otperformance = performance;
24718
24707
  });
24719
24708
 
24720
24709
  // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/platform/index.js
24721
24710
  var require_platform6 = __commonJS((exports) => {
24722
24711
  Object.defineProperty(exports, "__esModule", { value: true });
24723
- exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined;
24712
+ exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined;
24724
24713
  var node_1 = require_node7();
24725
24714
  Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() {
24726
24715
  return node_1.SDK_INFO;
@@ -24731,9 +24720,6 @@ var require_platform6 = __commonJS((exports) => {
24731
24720
  Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() {
24732
24721
  return node_1.otperformance;
24733
24722
  } });
24734
- Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() {
24735
- return node_1.unrefTimer;
24736
- } });
24737
24723
  Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() {
24738
24724
  return node_1.getBooleanFromEnv;
24739
24725
  } });
@@ -24765,16 +24751,11 @@ var require_time2 = __commonJS((exports) => {
24765
24751
  }
24766
24752
  exports.millisToHrTime = millisToHrTime;
24767
24753
  function getTimeOrigin() {
24768
- let timeOrigin = platform_1.otperformance.timeOrigin;
24769
- if (typeof timeOrigin !== "number") {
24770
- const perf = platform_1.otperformance;
24771
- timeOrigin = perf.timing && perf.timing.fetchStart;
24772
- }
24773
- return timeOrigin;
24754
+ return platform_1.otperformance.timeOrigin;
24774
24755
  }
24775
24756
  exports.getTimeOrigin = getTimeOrigin;
24776
24757
  function hrTime(performanceNow) {
24777
- const timeOrigin = millisToHrTime(getTimeOrigin());
24758
+ const timeOrigin = millisToHrTime(platform_1.otperformance.timeOrigin);
24778
24759
  const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now());
24779
24760
  return addHrTimes(timeOrigin, now);
24780
24761
  }
@@ -24783,7 +24764,7 @@ var require_time2 = __commonJS((exports) => {
24783
24764
  if (isTimeInputHrTime(time)) {
24784
24765
  return time;
24785
24766
  } else if (typeof time === "number") {
24786
- if (time < getTimeOrigin()) {
24767
+ if (time < platform_1.otperformance.timeOrigin) {
24787
24768
  return hrTime(time);
24788
24769
  } else {
24789
24770
  return millisToHrTime(time);
@@ -24844,6 +24825,18 @@ var require_time2 = __commonJS((exports) => {
24844
24825
  exports.addHrTimes = addHrTimes;
24845
24826
  });
24846
24827
 
24828
+ // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/common/timer-util.js
24829
+ var require_timer_util2 = __commonJS((exports) => {
24830
+ Object.defineProperty(exports, "__esModule", { value: true });
24831
+ exports.unrefTimer = undefined;
24832
+ function unrefTimer(timer) {
24833
+ if (typeof timer !== "number") {
24834
+ timer.unref();
24835
+ }
24836
+ }
24837
+ exports.unrefTimer = unrefTimer;
24838
+ });
24839
+
24847
24840
  // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/ExportResult.js
24848
24841
  var require_ExportResult2 = __commonJS((exports) => {
24849
24842
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -25333,13 +25326,13 @@ var require_callback2 = __commonJS((exports) => {
25333
25326
  var promise_1 = require_promise2();
25334
25327
 
25335
25328
  class BindOnceFuture {
25336
- _callback;
25337
- _that;
25338
25329
  _isCalled = false;
25339
25330
  _deferred = new promise_1.Deferred;
25340
- constructor(_callback, _that) {
25341
- this._callback = _callback;
25342
- this._that = _that;
25331
+ _callback;
25332
+ _that;
25333
+ constructor(callback, that) {
25334
+ this._callback = callback;
25335
+ this._that = that;
25343
25336
  }
25344
25337
  get isCalled() {
25345
25338
  return this._isCalled;
@@ -25399,9 +25392,7 @@ var require_exporter2 = __commonJS((exports) => {
25399
25392
  function _export(exporter, arg) {
25400
25393
  return new Promise((resolve) => {
25401
25394
  api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => {
25402
- exporter.export(arg, (result) => {
25403
- resolve(result);
25404
- });
25395
+ exporter.export(arg, resolve);
25405
25396
  });
25406
25397
  });
25407
25398
  }
@@ -25411,7 +25402,7 @@ var require_exporter2 = __commonJS((exports) => {
25411
25402
  // ../../node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core/build/src/index.js
25412
25403
  var require_src12 = __commonJS((exports) => {
25413
25404
  Object.defineProperty(exports, "__esModule", { value: true });
25414
- exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined;
25405
+ exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined;
25415
25406
  var W3CBaggagePropagator_1 = require_W3CBaggagePropagator2();
25416
25407
  Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() {
25417
25408
  return W3CBaggagePropagator_1.W3CBaggagePropagator;
@@ -25475,6 +25466,10 @@ var require_src12 = __commonJS((exports) => {
25475
25466
  Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() {
25476
25467
  return time_1.timeInputToHrTime;
25477
25468
  } });
25469
+ var timer_util_1 = require_timer_util2();
25470
+ Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() {
25471
+ return timer_util_1.unrefTimer;
25472
+ } });
25478
25473
  var ExportResult_1 = require_ExportResult2();
25479
25474
  Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() {
25480
25475
  return ExportResult_1.ExportResultCode;
@@ -25505,9 +25500,6 @@ var require_src12 = __commonJS((exports) => {
25505
25500
  Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() {
25506
25501
  return platform_1.otperformance;
25507
25502
  } });
25508
- Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() {
25509
- return platform_1.unrefTimer;
25510
- } });
25511
25503
  var composite_1 = require_composite2();
25512
25504
  Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() {
25513
25505
  return composite_1.CompositePropagator;
@@ -47612,7 +47604,7 @@ var package_default;
47612
47604
  var init_package = __esm(() => {
47613
47605
  package_default = {
47614
47606
  name: "@uipath/cli",
47615
- version: "0.1.21",
47607
+ version: "0.2.0",
47616
47608
  description: "Cross platform CLI for UiPath",
47617
47609
  repository: {
47618
47610
  type: "git",
@@ -64029,7 +64021,8 @@ var getBaseHtml = ({ title, message, type: type2 }) => {
64029
64021
  // ../auth/src/server.ts
64030
64022
  var startServer = async ({
64031
64023
  redirectUri,
64032
- timeoutMs = DEFAULT_AUTH_TIMEOUT_MS
64024
+ timeoutMs = DEFAULT_AUTH_TIMEOUT_MS,
64025
+ onListening
64033
64026
  }) => {
64034
64027
  let http;
64035
64028
  try {
@@ -64099,6 +64092,13 @@ var startServer = async ({
64099
64092
  });
64100
64093
  server.listen(redirectUri.port, () => {
64101
64094
  logger.info("Waiting for authentication callback on port:", redirectUri.port);
64095
+ if (onListening) {
64096
+ Promise.resolve(onListening()).catch((err) => {
64097
+ server.close();
64098
+ clearTimeout(timeoutHandle);
64099
+ reject(err);
64100
+ });
64101
+ }
64102
64102
  });
64103
64103
  const timeoutHandle = setTimeout(() => {
64104
64104
  server.close();
@@ -64121,24 +64121,34 @@ __export(exports_node_strategy, {
64121
64121
 
64122
64122
  class NodeAuthStrategy {
64123
64123
  async execute(url2, redirectUri) {
64124
- logger.info("Opening browser for authentication...");
64125
- logger.info(`If browser doesn't open, visit: ${url2}`);
64126
64124
  const fs7 = getFileSystem();
64127
- try {
64128
- await fs7.utils.open(url2);
64129
- } catch (err) {
64130
- const isSpawnError = err instanceof Error && "code" in err && err.code === "ENOENT";
64131
- if (isSpawnError) {
64132
- throw new Error("Could not open a browser. No supported browser launcher was found. " + `On a headless or minimal system, use non-interactive login instead:
64125
+ const callbackUrl = await startServer({
64126
+ redirectUri,
64127
+ onListening: async () => {
64128
+ let safeUrl = "";
64129
+ for (const ch of url2) {
64130
+ const c = ch.charCodeAt(0);
64131
+ if (c > 31 && (c < 128 || c > 159))
64132
+ safeUrl += ch;
64133
+ }
64134
+ logger.info("Opening browser for authentication...");
64135
+ logger.info(`If browser doesn't open, visit: ${safeUrl}`);
64136
+ const [openError] = await catchError(fs7.utils.open(url2));
64137
+ if (!openError)
64138
+ return;
64139
+ const isSpawnError = "code" in openError && openError.code === "ENOENT";
64140
+ if (isSpawnError) {
64141
+ throw new Error("Could not open a browser. No supported browser launcher was found. " + `On a headless or minimal system, use non-interactive login instead:
64133
64142
 
64134
64143
  ` + ` uip login --client-id <id> --client-secret <secret> -t <tenant>
64135
64144
 
64136
- ` + "Or install a browser opener for your OS (e.g. xdg-utils on Linux).", { cause: err });
64145
+ ` + "Or install a browser opener for your OS (e.g. xdg-utils on Linux).", { cause: openError });
64146
+ }
64147
+ throw new Error("Could not open the browser automatically. " + `Visit this URL to authenticate:
64148
+
64149
+ ${safeUrl}
64150
+ `, { cause: openError });
64137
64151
  }
64138
- throw err;
64139
- }
64140
- const callbackUrl = await startServer({
64141
- redirectUri
64142
64152
  });
64143
64153
  const code = callbackUrl.searchParams.get("code");
64144
64154
  if (!code) {
@@ -80351,6 +80361,126 @@ var init_claude = __esm(() => {
80351
80361
  init_src2();
80352
80362
  });
80353
80363
 
80364
+ // src/commands/skills/agents/codex.ts
80365
+ var exports_codex = {};
80366
+ __export(exports_codex, {
80367
+ uninstall: () => uninstall2,
80368
+ install: () => install2
80369
+ });
80370
+ async function install2(skill, rootDir) {
80371
+ const fs7 = getFileSystem();
80372
+ const target = fs7.path.join(rootDir, ".agents", "skills", skill.name);
80373
+ await fs7.mkdir(target);
80374
+ await fs7.copyDirectory(skill.skillDir, target);
80375
+ logger.info(` codex: installed ${skill.name}`);
80376
+ }
80377
+ async function uninstall2(skillName, rootDir) {
80378
+ const fs7 = getFileSystem();
80379
+ const target = fs7.path.join(rootDir, ".agents", "skills", skillName);
80380
+ if (await fs7.exists(target)) {
80381
+ await fs7.rm(target);
80382
+ }
80383
+ }
80384
+ var init_codex = __esm(() => {
80385
+ init_src();
80386
+ init_src2();
80387
+ });
80388
+
80389
+ // src/commands/skills/agents/copilot.ts
80390
+ var exports_copilot = {};
80391
+ __export(exports_copilot, {
80392
+ uninstall: () => uninstall3,
80393
+ install: () => install3
80394
+ });
80395
+ async function install3(skill, rootDir) {
80396
+ const fs7 = getFileSystem();
80397
+ const target = fs7.path.join(rootDir, ".github", "skills", skill.name);
80398
+ await fs7.mkdir(target);
80399
+ await fs7.copyDirectory(skill.skillDir, target);
80400
+ logger.info(` copilot: installed ${skill.name}`);
80401
+ }
80402
+ async function uninstall3(skillName, rootDir) {
80403
+ const fs7 = getFileSystem();
80404
+ const target = fs7.path.join(rootDir, ".github", "skills", skillName);
80405
+ if (await fs7.exists(target)) {
80406
+ await fs7.rm(target);
80407
+ }
80408
+ }
80409
+ var init_copilot = __esm(() => {
80410
+ init_src();
80411
+ init_src2();
80412
+ });
80413
+
80414
+ // src/commands/skills/agents/cursor.ts
80415
+ var exports_cursor = {};
80416
+ __export(exports_cursor, {
80417
+ uninstall: () => uninstall4,
80418
+ install: () => install4
80419
+ });
80420
+ async function install4(skill, rootDir) {
80421
+ const fs7 = getFileSystem();
80422
+ const target = fs7.path.join(rootDir, ".cursor", "skills", skill.name);
80423
+ await fs7.mkdir(target);
80424
+ await fs7.copyDirectory(skill.skillDir, target);
80425
+ logger.info(` cursor: installed ${skill.name}`);
80426
+ }
80427
+ async function uninstall4(skillName, rootDir) {
80428
+ const fs7 = getFileSystem();
80429
+ const target = fs7.path.join(rootDir, ".cursor", "skills", skillName);
80430
+ if (await fs7.exists(target)) {
80431
+ await fs7.rm(target);
80432
+ }
80433
+ }
80434
+ var init_cursor = __esm(() => {
80435
+ init_src();
80436
+ init_src2();
80437
+ });
80438
+
80439
+ // src/commands/skills/agents/gemini.ts
80440
+ var exports_gemini = {};
80441
+ __export(exports_gemini, {
80442
+ uninstall: () => uninstall5,
80443
+ install: () => install5
80444
+ });
80445
+ async function install5(skill, rootDir) {
80446
+ const fs7 = getFileSystem();
80447
+ const target = fs7.path.join(rootDir, ".gemini", "skills", skill.name);
80448
+ await fs7.mkdir(target);
80449
+ await fs7.copyDirectory(skill.skillDir, target);
80450
+ logger.info(` gemini: installed ${skill.name}`);
80451
+ }
80452
+ async function uninstall5(skillName, rootDir) {
80453
+ const fs7 = getFileSystem();
80454
+ const target = fs7.path.join(rootDir, ".gemini", "skills", skillName);
80455
+ if (await fs7.exists(target)) {
80456
+ await fs7.rm(target);
80457
+ }
80458
+ }
80459
+ var init_gemini = __esm(() => {
80460
+ init_src();
80461
+ init_src2();
80462
+ });
80463
+
80464
+ // src/commands/skills/agents/index.ts
80465
+ function getAgentHandler(name) {
80466
+ return AGENT_HANDLERS[name];
80467
+ }
80468
+ var AGENT_HANDLERS;
80469
+ var init_agents = __esm(() => {
80470
+ init_claude();
80471
+ init_codex();
80472
+ init_copilot();
80473
+ init_cursor();
80474
+ init_gemini();
80475
+ AGENT_HANDLERS = {
80476
+ claude: exports_claude,
80477
+ cursor: exports_cursor,
80478
+ copilot: exports_copilot,
80479
+ gemini: exports_gemini,
80480
+ codex: exports_codex
80481
+ };
80482
+ });
80483
+
80354
80484
  // src/commands/skills/contentStore.ts
80355
80485
  import { spawn } from "node:child_process";
80356
80486
  async function getContentStore(rootDir) {
@@ -80442,60 +80572,6 @@ function parseSkillMd(content) {
80442
80572
  const meta3 = jsYaml.load(fmMatch[1]) ?? {};
80443
80573
  return { meta: meta3, body: fmMatch[2] };
80444
80574
  }
80445
- async function getSkillMetadata(skillMdPath) {
80446
- const fs7 = getFileSystem();
80447
- const content = await fs7.readFile(skillMdPath, { encoding: "utf-8" });
80448
- if (content === null) {
80449
- throw new Error(`Skill metadata not found: ${skillMdPath}`);
80450
- }
80451
- return parseSkillMd(content);
80452
- }
80453
- function rewriteBody(body, skillDir, targetDir) {
80454
- const fs7 = getFileSystem();
80455
- const relFromTarget = fs7.path.relative(targetDir, skillDir).split("\\").join("/");
80456
- return body.replace(/(\[.*?\]\()(?!https?:\/\/|\/)([^)]+?)(\))/g, (_match, prefix, relPath, suffix) => {
80457
- const rewritten = [relFromTarget, relPath].join("/").replace(/\/+/g, "/");
80458
- return `${prefix}${rewritten}${suffix}`;
80459
- });
80460
- }
80461
- async function setMarkedBlock(filePath, marker, content, commentStyle = "hash") {
80462
- const startTag = commentStyle === "html" ? `<!-- ${marker} START -->` : `# ${marker} START`;
80463
- const endTag = commentStyle === "html" ? `<!-- ${marker} END -->` : `# ${marker} END`;
80464
- const fs7 = getFileSystem();
80465
- const block = `${startTag}
80466
- ${content}
80467
- ${endTag}`;
80468
- const existing = await fs7.readFile(filePath, { encoding: "utf-8" }) ?? "";
80469
- const startIdx = existing.indexOf(startTag);
80470
- const endIdx = existing.indexOf(endTag);
80471
- if (startIdx !== -1 && endIdx !== -1) {
80472
- const updated = existing.substring(0, startIdx) + block + existing.substring(endIdx + endTag.length);
80473
- await fs7.writeFile(filePath, updated);
80474
- } else {
80475
- const separator = existing.length > 0 && !existing.endsWith(`
80476
- `) ? `
80477
- ` : "";
80478
- await fs7.writeFile(filePath, `${existing}${separator}${block}
80479
- `);
80480
- }
80481
- }
80482
- async function removeMarkedBlock(filePath, marker, commentStyle = "hash") {
80483
- const fs7 = getFileSystem();
80484
- const startTag = commentStyle === "html" ? `<!-- ${marker} START -->` : `# ${marker} START`;
80485
- const endTag = commentStyle === "html" ? `<!-- ${marker} END -->` : `# ${marker} END`;
80486
- const existing = await fs7.readFile(filePath, { encoding: "utf-8" });
80487
- if (existing === null)
80488
- return;
80489
- const startIdx = existing.indexOf(startTag);
80490
- const endIdx = existing.indexOf(endTag);
80491
- if (startIdx === -1 || endIdx === -1)
80492
- return;
80493
- let updated = existing.substring(0, startIdx) + existing.substring(endIdx + endTag.length);
80494
- updated = updated.replace(/\n{3,}/g, `
80495
-
80496
- `);
80497
- await fs7.writeFile(filePath, updated);
80498
- }
80499
80575
  async function addToGitignore(rootDir, entry) {
80500
80576
  const fs7 = getFileSystem();
80501
80577
  const gitignorePath = fs7.path.join(rootDir, ".gitignore");
@@ -80636,165 +80712,6 @@ var init_contentStore = __esm(() => {
80636
80712
  STORE_NAME = `${UIPATH_HOME_DIR}/.skills`;
80637
80713
  });
80638
80714
 
80639
- // src/commands/skills/agents/codex.ts
80640
- var exports_codex = {};
80641
- __export(exports_codex, {
80642
- uninstall: () => uninstall2,
80643
- install: () => install2
80644
- });
80645
- async function install2(skill, rootDir) {
80646
- const fs7 = getFileSystem();
80647
- const isGlobal = fs7.path.resolve(rootDir) === fs7.path.resolve(fs7.env.homedir());
80648
- const targetFile = isGlobal ? fs7.path.join(rootDir, ".codex", "instructions.md") : fs7.path.join(rootDir, "codex.md");
80649
- await fs7.mkdir(fs7.path.dirname(targetFile));
80650
- const skillMdPath = fs7.path.join(skill.skillDir, "SKILL.md");
80651
- const relPath = fs7.path.relative(fs7.path.dirname(targetFile), skillMdPath).split("\\").join("/");
80652
- const marker = `uipath-skill:${skill.name}`;
80653
- const content = `See ${relPath} for ${skill.name} instructions.`;
80654
- await setMarkedBlock(targetFile, marker, content, "html");
80655
- logger.info(` codex: installed ${skill.name}`);
80656
- }
80657
- async function uninstall2(skillName, rootDir) {
80658
- const fs7 = getFileSystem();
80659
- const isGlobal = fs7.path.resolve(rootDir) === fs7.path.resolve(fs7.env.homedir());
80660
- const targetFile = isGlobal ? fs7.path.join(rootDir, ".codex", "instructions.md") : fs7.path.join(rootDir, "codex.md");
80661
- const marker = `uipath-skill:${skillName}`;
80662
- await removeMarkedBlock(targetFile, marker, "html");
80663
- }
80664
- var init_codex = __esm(() => {
80665
- init_src();
80666
- init_src2();
80667
- init_contentStore();
80668
- });
80669
-
80670
- // src/commands/skills/agents/copilot.ts
80671
- var exports_copilot = {};
80672
- __export(exports_copilot, {
80673
- uninstall: () => uninstall3,
80674
- install: () => install3
80675
- });
80676
- async function install3(skill, rootDir) {
80677
- const fs7 = getFileSystem();
80678
- const skillMdPath = fs7.path.join(skill.skillDir, "SKILL.md");
80679
- const { meta: meta3, body } = await getSkillMetadata(skillMdPath);
80680
- const targetDir = fs7.path.join(rootDir, ".github", "instructions");
80681
- await fs7.mkdir(targetDir);
80682
- const rewritten = rewriteBody(body, skill.skillDir, targetDir);
80683
- const header = meta3.globs ? `---
80684
- applyTo: "${Array.isArray(meta3.globs) ? meta3.globs.join(", ") : meta3.globs}"
80685
- ---
80686
- ` : "";
80687
- await fs7.writeFile(fs7.path.join(targetDir, `${skill.name}.instructions.md`), header + rewritten);
80688
- logger.info(` copilot: installed ${skill.name}`);
80689
- }
80690
- async function uninstall3(skillName, rootDir) {
80691
- const fs7 = getFileSystem();
80692
- const target = fs7.path.join(rootDir, ".github", "instructions", `${skillName}.instructions.md`);
80693
- if (await fs7.exists(target)) {
80694
- await fs7.rm(target);
80695
- }
80696
- }
80697
- var init_copilot = __esm(() => {
80698
- init_src();
80699
- init_src2();
80700
- init_contentStore();
80701
- });
80702
-
80703
- // src/commands/skills/agents/cursor.ts
80704
- var exports_cursor = {};
80705
- __export(exports_cursor, {
80706
- uninstall: () => uninstall4,
80707
- install: () => install4
80708
- });
80709
- async function install4(skill, rootDir) {
80710
- const fs7 = getFileSystem();
80711
- const skillMdPath = fs7.path.join(skill.skillDir, "SKILL.md");
80712
- const { meta: meta3, body } = await getSkillMetadata(skillMdPath);
80713
- const targetDir = fs7.path.join(rootDir, ".cursor", "rules");
80714
- await fs7.mkdir(targetDir);
80715
- const rewritten = rewriteBody(body, skill.skillDir, targetDir);
80716
- const mdc = buildMdc(skill.name, meta3, rewritten);
80717
- await fs7.writeFile(fs7.path.join(targetDir, `${skill.name}.mdc`), mdc);
80718
- logger.info(` cursor: installed ${skill.name}`);
80719
- }
80720
- async function uninstall4(skillName, rootDir) {
80721
- const fs7 = getFileSystem();
80722
- const target = fs7.path.join(rootDir, ".cursor", "rules", `${skillName}.mdc`);
80723
- if (await fs7.exists(target)) {
80724
- await fs7.rm(target);
80725
- }
80726
- }
80727
- function buildMdc(skillName, meta3, body) {
80728
- const description = meta3.description || skillName;
80729
- const globs = Array.isArray(meta3.globs) ? meta3.globs.join(", ") : "";
80730
- let frontmatter = `---
80731
- description: ${description}
80732
- `;
80733
- if (globs) {
80734
- frontmatter += `globs: ${globs}
80735
- `;
80736
- }
80737
- frontmatter += `alwaysApply: false
80738
- ---
80739
- `;
80740
- return frontmatter + body;
80741
- }
80742
- var init_cursor = __esm(() => {
80743
- init_src();
80744
- init_src2();
80745
- init_contentStore();
80746
- });
80747
-
80748
- // src/commands/skills/agents/gemini.ts
80749
- var exports_gemini = {};
80750
- __export(exports_gemini, {
80751
- uninstall: () => uninstall5,
80752
- install: () => install5
80753
- });
80754
- async function install5(skill, rootDir) {
80755
- const fs7 = getFileSystem();
80756
- const geminiDir = fs7.path.join(rootDir, ".gemini");
80757
- const geminiMd = fs7.path.join(geminiDir, "GEMINI.md");
80758
- await fs7.mkdir(geminiDir);
80759
- const skillMdPath = fs7.path.join(skill.skillDir, "SKILL.md");
80760
- const relPath = fs7.path.relative(geminiDir, skillMdPath).split("\\").join("/");
80761
- const marker = `uipath-skill:${skill.name}`;
80762
- const content = `@import ${relPath}`;
80763
- await setMarkedBlock(geminiMd, marker, content, "html");
80764
- logger.info(` gemini: installed ${skill.name}`);
80765
- }
80766
- async function uninstall5(skillName, rootDir) {
80767
- const fs7 = getFileSystem();
80768
- const geminiMd = fs7.path.join(rootDir, ".gemini", "GEMINI.md");
80769
- const marker = `uipath-skill:${skillName}`;
80770
- await removeMarkedBlock(geminiMd, marker, "html");
80771
- }
80772
- var init_gemini = __esm(() => {
80773
- init_src();
80774
- init_src2();
80775
- init_contentStore();
80776
- });
80777
-
80778
- // src/commands/skills/agents/index.ts
80779
- function getAgentHandler(name) {
80780
- return AGENT_HANDLERS[name];
80781
- }
80782
- var AGENT_HANDLERS;
80783
- var init_agents = __esm(() => {
80784
- init_claude();
80785
- init_codex();
80786
- init_copilot();
80787
- init_cursor();
80788
- init_gemini();
80789
- AGENT_HANDLERS = {
80790
- claude: exports_claude,
80791
- cursor: exports_cursor,
80792
- copilot: exports_copilot,
80793
- gemini: exports_gemini,
80794
- codex: exports_codex
80795
- };
80796
- });
80797
-
80798
80715
  // ../../node_modules/@inquirer/checkbox/node_modules/@inquirer/core/dist/lib/key.js
80799
80716
  var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p", isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n", isSpaceKey = (key) => key.name === "space", isNumberKey = (key) => "1234567890".includes(key.name), isEnterKey = (key) => key.name === "enter" || key.name === "return";
80800
80717
 
@@ -80935,6 +80852,9 @@ var init_hook_engine = __esm(() => {
80935
80852
 
80936
80853
  // ../../node_modules/@inquirer/checkbox/node_modules/@inquirer/core/dist/lib/use-state.js
80937
80854
  import { AsyncResource as AsyncResource2 } from "node:async_hooks";
80855
+ function isFactory(value) {
80856
+ return typeof value === "function";
80857
+ }
80938
80858
  function useState(defaultValue) {
80939
80859
  return withPointer((pointer) => {
80940
80860
  const setState = AsyncResource2.bind(function setState2(newValue) {
@@ -80946,7 +80866,7 @@ function useState(defaultValue) {
80946
80866
  if (pointer.initialized) {
80947
80867
  return [pointer.get(), setState];
80948
80868
  }
80949
- const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
80869
+ const value = isFactory(defaultValue) ? defaultValue() : defaultValue;
80950
80870
  pointer.set(value);
80951
80871
  return [value, setState];
80952
80872
  });
@@ -80973,10 +80893,10 @@ var init_use_effect = __esm(() => {
80973
80893
  // ../../node_modules/@inquirer/figures/dist/index.js
80974
80894
  import process11 from "node:process";
80975
80895
  function isUnicodeSupported() {
80976
- if (process11.platform !== "win32") {
80896
+ if (!process11.platform.startsWith("win")) {
80977
80897
  return process11.env["TERM"] !== "linux";
80978
80898
  }
80979
- return Boolean(process11.env["WT_SESSION"]) || Boolean(process11.env["TERMINUS_SUBLIME"]) || process11.env["ConEmuTask"] === "{cmd::Cmder}" || process11.env["TERM_PROGRAM"] === "Terminus-Sublime" || process11.env["TERM_PROGRAM"] === "vscode" || process11.env["TERM"] === "xterm-256color" || process11.env["TERM"] === "alacritty" || process11.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
80899
+ return Boolean(process11.env["CI"]) || Boolean(process11.env["WT_SESSION"]) || Boolean(process11.env["TERMINUS_SUBLIME"]) || process11.env["ConEmuTask"] === "{cmd::Cmder}" || process11.env["TERM_PROGRAM"] === "Terminus-Sublime" || process11.env["TERM_PROGRAM"] === "vscode" || process11.env["TERM"] === "xterm-256color" || process11.env["TERM"] === "alacritty" || process11.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
80980
80900
  }
80981
80901
  var common2, specialMainSymbols, specialFallbackSymbols, mainSymbols, fallbackSymbols, shouldUseMain, figures, dist_default, replacements;
80982
80902
  var init_dist2 = __esm(() => {
@@ -82302,6 +82222,7 @@ var init_promise_polyfill = __esm(() => {
82302
82222
  // ../../node_modules/@inquirer/checkbox/node_modules/@inquirer/core/dist/lib/create-prompt.js
82303
82223
  import * as readline2 from "node:readline";
82304
82224
  import { AsyncResource as AsyncResource3 } from "node:async_hooks";
82225
+ import path3 from "node:path";
82305
82226
  function getCallSites() {
82306
82227
  const _prepareStackTrace = Error.prepareStackTrace;
82307
82228
  let result = [];
@@ -82357,13 +82278,22 @@ function createPrompt(view) {
82357
82278
  const checkCursorPos = () => screen.checkCursorPos();
82358
82279
  rl.input.on("keypress", checkCursorPos);
82359
82280
  cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
82281
+ let pendingDone = null;
82360
82282
  cycle(() => {
82283
+ let effectsSettled = false;
82361
82284
  try {
82362
82285
  const nextView = view(config2, (value) => {
82363
- setImmediate(() => resolve2(value));
82286
+ if (effectsSettled) {
82287
+ resolve2(value);
82288
+ } else {
82289
+ pendingDone = { value };
82290
+ }
82364
82291
  });
82365
82292
  if (nextView === undefined) {
82366
- const callerFilename = callSites[1]?.getFileName();
82293
+ let callerFilename = callSites[1]?.getFileName();
82294
+ if (callerFilename && !callerFilename.startsWith("file://")) {
82295
+ callerFilename = path3.resolve(callerFilename);
82296
+ }
82367
82297
  throw new Error(`Prompt functions must return a string.
82368
82298
  at ${callerFilename}`);
82369
82299
  }
@@ -82373,6 +82303,12 @@ function createPrompt(view) {
82373
82303
  } catch (error48) {
82374
82304
  reject(error48);
82375
82305
  }
82306
+ effectsSettled = true;
82307
+ if (pendingDone !== null) {
82308
+ const { value } = pendingDone;
82309
+ pendingDone = null;
82310
+ resolve2(value);
82311
+ }
82376
82312
  });
82377
82313
  };
82378
82314
  if ("readableFlowing" in input) {
@@ -82461,12 +82397,13 @@ function normalizeChoices(choices) {
82461
82397
  return choices.map((choice) => {
82462
82398
  if (Separator.isSeparator(choice))
82463
82399
  return choice;
82464
- if (typeof choice === "string") {
82400
+ if (typeof choice !== "object" || choice === null || !("value" in choice)) {
82401
+ const name2 = String(choice);
82465
82402
  return {
82466
82403
  value: choice,
82467
- name: choice,
82468
- short: choice,
82469
- checkedName: choice,
82404
+ name: name2,
82405
+ short: name2,
82406
+ checkedName: name2,
82470
82407
  disabled: false,
82471
82408
  checked: false
82472
82409
  };
@@ -82641,11 +82578,6 @@ var init_dist8 = __esm(() => {
82641
82578
  });
82642
82579
 
82643
82580
  // src/commands/skills/prompt.ts
82644
- function truncate(text, maxLen) {
82645
- if (text.length <= maxLen)
82646
- return text;
82647
- return `${text.slice(0, maxLen - 3)}...`;
82648
- }
82649
82581
  async function promptAgentSelection(operation = "manage") {
82650
82582
  const selected = await dist_default4({
82651
82583
  message: `Select agents to ${operation} skills for`,
@@ -82658,18 +82590,6 @@ async function promptAgentSelection(operation = "manage") {
82658
82590
  });
82659
82591
  return selected;
82660
82592
  }
82661
- async function promptSkillSelection(skills, operation = "manage") {
82662
- const selected = await dist_default4({
82663
- message: `Select skills to ${operation}`,
82664
- required: true,
82665
- choices: skills.map((s) => ({
82666
- name: s.name,
82667
- value: s.name,
82668
- description: s.description ? truncate(s.description, 120) : undefined
82669
- }))
82670
- });
82671
- return selected;
82672
- }
82673
82593
  var ALL_AGENTS, AGENT_DISPLAY_NAMES, AGENT_DESTINATIONS;
82674
82594
  var init_prompt2 = __esm(() => {
82675
82595
  init_dist8();
@@ -82689,10 +82609,10 @@ var init_prompt2 = __esm(() => {
82689
82609
  };
82690
82610
  AGENT_DESTINATIONS = {
82691
82611
  claude: ".claude/skills/<skill>/",
82692
- cursor: ".cursor/rules/<skill>.mdc",
82693
- copilot: ".github/instructions/<skill>.instructions.md",
82694
- gemini: ".gemini/GEMINI.md",
82695
- codex: "~/.codex/instructions.md"
82612
+ cursor: ".cursor/skills/<skill>/",
82613
+ copilot: ".github/skills/<skill>/",
82614
+ gemini: ".gemini/skills/<skill>/",
82615
+ codex: ".agents/skills/<skill>/"
82696
82616
  };
82697
82617
  });
82698
82618
 
@@ -82716,53 +82636,23 @@ async function resolveSkillsContext(options, operation) {
82716
82636
  Message: "No skills found in content store.",
82717
82637
  Instructions: "Check that the skills repository contains skills in the skills/ directory."
82718
82638
  });
82719
- process.exitCode = 1;
82639
+ processContext.exit(1);
82720
82640
  return null;
82721
82641
  }
82722
- let selectedSkills = availableSkills;
82723
- if (!options.skills && !options.agents) {
82724
- const [skillErr, chosen] = await catchError(promptSkillSelection(availableSkills, operation));
82725
- if (skillErr)
82726
- handlePromptCancellation(skillErr, operation);
82727
- selectedSkills = availableSkills.filter((s) => chosen.includes(s.name));
82728
- } else if (options.skills) {
82729
- const requested = options.skills.split(",").map((s) => s.trim());
82730
- const availableNames = availableSkills.map((s) => s.name);
82731
- const unknown3 = requested.filter((s) => !availableNames.includes(s));
82732
- if (unknown3.length > 0) {
82733
- const manifest = await readManifest(storePath);
82734
- const previouslyInstalled = unknown3.filter((s) => manifest.skills[s]);
82735
- const neverSeen = unknown3.filter((s) => !manifest.skills[s]);
82736
- const parts = [];
82737
- if (previouslyInstalled.length > 0) {
82738
- parts.push(`Skills no longer available: ${previouslyInstalled.join(", ")}. They may have been removed or renamed.`);
82739
- }
82740
- if (neverSeen.length > 0) {
82741
- parts.push(`Unknown skills: ${neverSeen.join(", ")}`);
82742
- }
82743
- OutputFormatter.error({
82744
- Result: "Failure",
82745
- Message: parts.join(" "),
82746
- Instructions: `Available skills: ${availableNames.join(", ")}`
82747
- });
82748
- process.exitCode = 1;
82749
- return null;
82750
- }
82751
- selectedSkills = availableSkills.filter((s) => requested.includes(s.name));
82752
- }
82642
+ const selectedSkills = availableSkills;
82753
82643
  let agents;
82754
- if (options.agents) {
82755
- agents = options.agents.split(",").map((s) => s.trim().toLowerCase());
82756
- const unknown3 = agents.filter((a) => !ALL_AGENTS.includes(a));
82757
- if (unknown3.length > 0) {
82644
+ if (options.agent) {
82645
+ const agent = options.agent.trim().toLowerCase();
82646
+ if (!ALL_AGENTS.includes(agent)) {
82758
82647
  OutputFormatter.error({
82759
82648
  Result: "Failure",
82760
- Message: `Unknown agents: ${unknown3.join(", ")}`,
82649
+ Message: `Unknown agent: ${agent}`,
82761
82650
  Instructions: `Available agents: ${ALL_AGENTS.join(", ")}`
82762
82651
  });
82763
- process.exitCode = 1;
82652
+ processContext.exit(1);
82764
82653
  return null;
82765
82654
  }
82655
+ agents = [agent];
82766
82656
  } else {
82767
82657
  const [agentErr, selected] = await catchError(promptAgentSelection(operation));
82768
82658
  if (agentErr)
@@ -82784,7 +82674,7 @@ async function runAgentInstalls(resolved) {
82784
82674
  Message: `Failed to install ${skill.name} for ${agent}: ${installError.message}`,
82785
82675
  Instructions: "Check that the content store is intact and you have write permissions."
82786
82676
  });
82787
- process.exitCode = 1;
82677
+ processContext.exit(1);
82788
82678
  return null;
82789
82679
  }
82790
82680
  installed.push(`${agent}:${skill.name}`);
@@ -82797,7 +82687,7 @@ async function runAgentInstalls(resolved) {
82797
82687
  Message: `Failed to update manifest: ${manifestError.message}`,
82798
82688
  Instructions: "Check that the content store is intact and you have write permissions."
82799
82689
  });
82800
- process.exitCode = 1;
82690
+ processContext.exit(1);
82801
82691
  return null;
82802
82692
  }
82803
82693
  if (isLocal) {
@@ -82808,12 +82698,32 @@ async function runAgentInstalls(resolved) {
82808
82698
  Message: `Failed to update .gitignore: ${gitignoreError.message}`,
82809
82699
  Instructions: "Check that you have write permissions to the project directory."
82810
82700
  });
82811
- process.exitCode = 1;
82701
+ processContext.exit(1);
82812
82702
  return null;
82813
82703
  }
82814
82704
  }
82815
82705
  return installed;
82816
82706
  }
82707
+ async function cleanupStaleSkills(resolved) {
82708
+ const { storePath, rootDir, agents } = resolved;
82709
+ const [manifestErr, manifest] = await catchError(readManifest(storePath));
82710
+ if (manifestErr || !manifest || Object.keys(manifest.skills).length === 0)
82711
+ return;
82712
+ const availableNames = resolved.selectedSkills.map((s) => s.name);
82713
+ const staleNames = Object.keys(manifest.skills).filter((s) => !availableNames.includes(s));
82714
+ if (staleNames.length === 0)
82715
+ return;
82716
+ for (const name of staleNames) {
82717
+ for (const agent of agents) {
82718
+ const handler = getAgentHandler(agent);
82719
+ const [err] = await catchError(handler.uninstall(name, rootDir));
82720
+ if (err) {
82721
+ logger.debug(`Failed to clean up stale skill ${name} for ${agent}: ${err.message}`);
82722
+ }
82723
+ }
82724
+ await catchError(removeFromManifest(storePath, [name], agents));
82725
+ }
82726
+ }
82817
82727
  var init_skillsService = __esm(() => {
82818
82728
  init_src();
82819
82729
  init_src2();
@@ -82824,7 +82734,7 @@ var init_skillsService = __esm(() => {
82824
82734
 
82825
82735
  // src/commands/skills/install.ts
82826
82736
  function registerInstallCommand(skillsCommand) {
82827
- skillsCommand.command("install").description("Download skills from UiPath and install them for your coding agents.").option("--agents <agents>", "Target agents: claude, cursor, copilot, gemini, codex (comma-separated)").option("--skills <skills>", "Specific skills to install (comma-separated)").option("--local", "Install to current project instead of globally").trackedAction(processContext, async (options) => {
82737
+ skillsCommand.command("install").description("Download skills from UiPath and install them for your coding agents.").option("--agent <agent>", "Target agent: claude, cursor, copilot, gemini, codex").option("--local", "Install to current project instead of globally").trackedAction(processContext, async (options) => {
82828
82738
  const [contextError, resolved] = await catchError(resolveSkillsContext(options, "install"));
82829
82739
  if (contextError || !resolved) {
82830
82740
  if (contextError) {
@@ -82863,82 +82773,83 @@ var init_install = __esm(() => {
82863
82773
 
82864
82774
  // src/commands/skills/uninstall.ts
82865
82775
  function registerUninstallCommand(skillsCommand) {
82866
- skillsCommand.command("uninstall").description("Remove previously installed skills from agent configurations.").option("--agents <agents>", "Target agents: claude, cursor, copilot, gemini, codex (comma-separated)").option("--skills <skills>", "Specific skills to uninstall (comma-separated)").option("--local", "Uninstall from current project instead of globally").trackedAction(processContext, async (options) => {
82867
- const [contextError, resolved] = await catchError(resolveSkillsContext(options, "uninstall"));
82776
+ skillsCommand.command("uninstall").description("Remove previously installed skills from agent configurations.").option("--agent <agent>", "Target agent: claude, cursor, copilot, gemini, codex").option("--local", "Uninstall from current project instead of globally").trackedAction(processContext, async (options) => {
82868
82777
  const isLocal = !!options.local;
82869
- let rootDir;
82870
- let storePath;
82871
- let skillNames;
82778
+ const fs7 = getFileSystem();
82779
+ const rootDir = isLocal ? fs7.env.cwd() : fs7.env.homedir();
82780
+ const storePath = fs7.path.join(rootDir, STORE_NAME);
82872
82781
  let agents;
82873
- if (contextError) {
82874
- if (contextError.exitCode === 130) {
82875
- processContext.exit(130);
82782
+ if (options.agent) {
82783
+ const agent = options.agent.trim().toLowerCase();
82784
+ if (!ALL_AGENTS.includes(agent)) {
82785
+ OutputFormatter.error({
82786
+ Result: "Failure",
82787
+ Message: `Unknown agent: ${agent}`,
82788
+ Instructions: `Available agents: ${ALL_AGENTS.join(", ")}`
82789
+ });
82790
+ processContext.exit(1);
82876
82791
  return;
82877
82792
  }
82793
+ agents = [agent];
82794
+ } else {
82795
+ const [agentErr, selected] = await catchError(promptAgentSelection("uninstall"));
82796
+ if (agentErr) {
82797
+ if (agentErr instanceof Error && agentErr.name === "ExitPromptError") {
82798
+ processContext.exit(130);
82799
+ return;
82800
+ }
82801
+ throw agentErr;
82802
+ }
82803
+ agents = selected;
82804
+ }
82805
+ const [manifestErr, manifest] = await catchError(readManifest(storePath));
82806
+ if (manifestErr || !manifest) {
82878
82807
  OutputFormatter.error({
82879
82808
  Result: "Failure",
82880
- Message: `Failed to uninstall skills: ${contextError.message}`,
82881
- Instructions: "Check network connectivity and try again. Ensure git is installed."
82809
+ Message: `Failed to read manifest: ${manifestErr?.message ?? "unknown error"}`,
82810
+ Instructions: "The manifest file may be missing or corrupted. Try reinstalling with 'uipath skills install'."
82882
82811
  });
82883
82812
  processContext.exit(1);
82884
82813
  return;
82885
82814
  }
82886
- if (resolved) {
82887
- rootDir = resolved.rootDir;
82888
- storePath = resolved.storePath;
82889
- skillNames = resolved.selectedSkills.map((s) => s.name);
82890
- agents = resolved.agents;
82891
- } else {
82892
- if (!options.skills || !options.agents) {
82893
- return;
82894
- }
82895
- const fs7 = getFileSystem();
82896
- rootDir = isLocal ? fs7.env.cwd() : fs7.env.homedir();
82897
- storePath = fs7.path.join(rootDir, STORE_NAME);
82898
- const manifest = await readManifest(storePath);
82899
- const requested = options.skills.split(",").map((s) => s.trim());
82900
- const inManifest = requested.filter((s) => manifest.skills[s]);
82901
- if (inManifest.length === 0) {
82902
- OutputFormatter.error({
82903
- Result: "Failure",
82904
- Message: `Skills not found in manifest: ${requested.join(", ")}`,
82905
- Instructions: "These skills are not currently installed. Use 'uipath skills install' to install them first."
82906
- });
82907
- processContext.exit(1);
82908
- return;
82909
- }
82910
- skillNames = inManifest;
82911
- agents = options.agents.split(",").map((s) => s.trim().toLowerCase());
82912
- const unknownAgents = agents.filter((a) => !ALL_AGENTS.includes(a));
82913
- if (unknownAgents.length > 0) {
82914
- OutputFormatter.error({
82915
- Result: "Failure",
82916
- Message: `Unknown agents: ${unknownAgents.join(", ")}`,
82917
- Instructions: `Available agents: ${ALL_AGENTS.join(", ")}`
82918
- });
82919
- processContext.exit(1);
82920
- return;
82921
- }
82922
- logger.info(`Uninstalling skills from manifest: ${inManifest.join(", ")}`);
82815
+ const skillNames = Object.keys(manifest.skills);
82816
+ if (skillNames.length === 0) {
82817
+ OutputFormatter.error({
82818
+ Result: "Failure",
82819
+ Message: "No skills found to uninstall.",
82820
+ Instructions: "No skills are currently installed. Use 'uipath skills install' to install them first."
82821
+ });
82822
+ processContext.exit(1);
82823
+ return;
82923
82824
  }
82825
+ logger.info(`Uninstalling ${skillNames.length} skill(s) for ${agents.join(", ")}`);
82924
82826
  const uninstalled = [];
82925
- for (const agent of agents) {
82926
- const handler = getAgentHandler(agent);
82827
+ for (const targetAgent of agents) {
82828
+ const handler = getAgentHandler(targetAgent);
82927
82829
  for (const name of skillNames) {
82928
82830
  const [uninstallError] = await catchError(handler.uninstall(name, rootDir));
82929
82831
  if (uninstallError) {
82930
82832
  OutputFormatter.error({
82931
82833
  Result: "Failure",
82932
- Message: `Failed to uninstall ${name} for ${agent}: ${uninstallError.message}`,
82834
+ Message: `Failed to uninstall ${name} for ${targetAgent}: ${uninstallError.message}`,
82933
82835
  Instructions: "Check that the skill files exist and you have write permissions."
82934
82836
  });
82935
82837
  processContext.exit(1);
82936
82838
  return;
82937
82839
  }
82938
- uninstalled.push(`${agent}:${name}`);
82840
+ uninstalled.push(`${targetAgent}:${name}`);
82939
82841
  }
82940
82842
  }
82941
- await removeFromManifest(storePath, skillNames, agents);
82843
+ const [manifestUpdateErr] = await catchError(removeFromManifest(storePath, skillNames, agents));
82844
+ if (manifestUpdateErr) {
82845
+ OutputFormatter.error({
82846
+ Result: "Failure",
82847
+ Message: `Failed to update manifest: ${manifestUpdateErr.message}`,
82848
+ Instructions: "Skills were uninstalled but the manifest could not be updated. Try again."
82849
+ });
82850
+ processContext.exit(1);
82851
+ return;
82852
+ }
82942
82853
  OutputFormatter.success({
82943
82854
  Result: "Success",
82944
82855
  Code: "SkillsUninstall",
@@ -82957,12 +82868,11 @@ var init_uninstall = __esm(() => {
82957
82868
  init_agents();
82958
82869
  init_contentStore();
82959
82870
  init_prompt2();
82960
- init_skillsService();
82961
82871
  });
82962
82872
 
82963
82873
  // src/commands/skills/update.ts
82964
82874
  function registerUpdateCommand(skillsCommand) {
82965
- skillsCommand.command("update").description("Re-fetch skills from UiPath and reinstall to get the latest versions.").option("--agents <agents>", "Target agents: claude, cursor, copilot, gemini, codex (comma-separated)").option("--skills <skills>", "Specific skills to update (comma-separated)").option("--local", "Update in current project instead of globally").trackedAction(processContext, async (options) => {
82875
+ skillsCommand.command("update").description("Re-fetch skills from UiPath and reinstall to get the latest versions.").option("--agent <agent>", "Target agent: claude, cursor, copilot, gemini, codex").option("--local", "Update in current project instead of globally").trackedAction(processContext, async (options) => {
82966
82876
  const [contextError, resolved] = await catchError(resolveSkillsContext(options, "update"));
82967
82877
  if (contextError || !resolved) {
82968
82878
  if (contextError) {
@@ -82979,20 +82889,10 @@ function registerUpdateCommand(skillsCommand) {
82979
82889
  }
82980
82890
  return;
82981
82891
  }
82982
- if (!options.skills) {
82983
- const [manifestErr, manifest] = await catchError(readManifest(resolved.storePath));
82984
- const [skillsErr, availableSkills] = await catchError(getAvailableSkills(resolved.storePath));
82985
- if (!manifestErr && !skillsErr && availableSkills) {
82986
- const availableNames = availableSkills.map((s) => s.name);
82987
- const removed = Object.keys(manifest.skills).filter((s) => !availableNames.includes(s));
82988
- if (removed.length > 0) {
82989
- logger.warn(`Previously installed skills no longer available: ${removed.join(", ")}. They may have been removed or renamed. Use 'uipath skills uninstall --skills ${removed.join(",")}' to clean up.`);
82990
- }
82991
- }
82992
- }
82993
82892
  const updated = await runAgentInstalls(resolved);
82994
82893
  if (!updated)
82995
82894
  return;
82895
+ await cleanupStaleSkills(resolved);
82996
82896
  OutputFormatter.success({
82997
82897
  Result: "Success",
82998
82898
  Code: "SkillsUpdate",
@@ -83007,7 +82907,6 @@ function registerUpdateCommand(skillsCommand) {
83007
82907
  }
83008
82908
  var init_update = __esm(() => {
83009
82909
  init_src();
83010
- init_contentStore();
83011
82910
  init_skillsService();
83012
82911
  });
83013
82912
 
@@ -83017,7 +82916,7 @@ function registerSkillsCommand(program2) {
83017
82916
 
83018
82917
  ` + `Skills teach AI coding agents how to build UiPath automations, agents,
83019
82918
  ` + `RPA workflows, flows, and orchestrations. They are fetched from the UiPath
83020
- ` + `skills repository on GitHub and installed into each agent's config format.
82919
+ ` + `skills repository on GitHub and installed for each agent.
83021
82920
  ` + AGENTS_TABLE);
83022
82921
  registerInstallCommand(skillsCommand);
83023
82922
  registerUpdateCommand(skillsCommand);
@@ -83033,10 +82932,39 @@ Supported agents:
83033
82932
  ` + ` Agent Destination
83034
82933
  ` + ` ─────────────── ──────────────────────────────────────────────────
83035
82934
  ` + ` Claude Code .claude/skills/<skill>/
83036
- ` + ` Cursor .cursor/rules/<skill>.mdc
83037
- ` + ` GitHub Copilot .github/instructions/<skill>.instructions.md
83038
- ` + ` Gemini CLI .gemini/GEMINI.md (appends @import)
83039
- ` + " Codex ~/.codex/instructions.md or codex.md (appends reference)";
82935
+ ` + ` Cursor .cursor/skills/<skill>/
82936
+ ` + ` GitHub Copilot .github/skills/<skill>/
82937
+ ` + ` Gemini CLI .gemini/skills/<skill>/
82938
+ ` + " Codex .agents/skills/<skill>/";
82939
+ });
82940
+
82941
+ // src/services/tools-whitelist.ts
82942
+ var TOOLS_WHITELIST, WHITELIST_BY_COMMAND, WHITELIST_BY_SHORT_NAME;
82943
+ var init_tools_whitelist = __esm(() => {
82944
+ TOOLS_WHITELIST = new Map([
82945
+ ["@uipath/solution-tool", "solution"],
82946
+ ["@uipath/agent-tool", "agent"],
82947
+ ["@uipath/codedagent-tool", "codedagent"],
82948
+ ["@uipath/codedapp-tool", "codedapp"],
82949
+ ["@uipath/integrationservice-tool", "is"],
82950
+ ["@uipath/orchestrator-tool", "or"],
82951
+ ["@uipath/rpa-tool", "rpa"],
82952
+ ["@uipath/flow-tool", "flow"],
82953
+ ["@uipath/case-tool", "case"],
82954
+ ["@uipath/test-manager-tool", "tm"],
82955
+ ["@uipath/resource-tool", "resource"],
82956
+ ["@uipath/api-workflow-tool", "api-workflow"],
82957
+ ["@uipath/maestro-tool", "maestro"],
82958
+ ["@uipath/docsai-tool", "docsai"],
82959
+ ["@uipath/vertical-solutions-tool", "vss"],
82960
+ ["@uipath/rpa-legacy-tool", "rpa-legacy"],
82961
+ ["@uipath/traces-tool", "traces"]
82962
+ ]);
82963
+ WHITELIST_BY_COMMAND = new Map([...TOOLS_WHITELIST.entries()].map(([pkg, cmd]) => [cmd, pkg]));
82964
+ WHITELIST_BY_SHORT_NAME = new Map([...TOOLS_WHITELIST.keys()].map((pkg) => [
82965
+ pkg.replace(/^@uipath\//, ""),
82966
+ pkg
82967
+ ]));
83040
82968
  });
83041
82969
 
83042
82970
  // src/utils/npmrc.ts
@@ -83466,37 +83394,16 @@ function truncateVersionsForDisplay(versions2) {
83466
83394
  }
83467
83395
  return result;
83468
83396
  }
83469
- var SEMVER_RE, SAFE_PACKAGE_SPEC, SAFE_VERSION, NPM_TIMEOUT_MS = 180000, NPM_MAX_RETRIES = 2, TRANSIENT_NPM_ERRORS, TOOLS_WHITELIST, WHITELIST_BY_COMMAND, WHITELIST_BY_SHORT_NAME, DEFAULT_REGISTRY = "https://registry.npmjs.org", toolService;
83397
+ var SEMVER_RE, SAFE_PACKAGE_SPEC, SAFE_VERSION, NPM_TIMEOUT_MS = 180000, NPM_MAX_RETRIES = 2, TRANSIENT_NPM_ERRORS, DEFAULT_REGISTRY = "https://registry.npmjs.org", toolService;
83470
83398
  var init_toolService = __esm(() => {
83471
83399
  init_src();
83472
83400
  init_src2();
83401
+ init_tools_whitelist();
83402
+ init_tools_whitelist();
83473
83403
  SEMVER_RE = /^\d+\.\d+\.\d+(-[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)?(\+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)?$/;
83474
83404
  SAFE_PACKAGE_SPEC = /^@?[a-zA-Z0-9._/-]+(@[a-zA-Z0-9._+:~^<>=| -]+)?$/;
83475
83405
  SAFE_VERSION = /^[a-zA-Z0-9._+:~^<>=| -]+$/;
83476
83406
  TRANSIENT_NPM_ERRORS = ["ENOTEMPTY", "EPERM", "EBUSY"];
83477
- TOOLS_WHITELIST = new Map([
83478
- ["@uipath/solution-tool", "solution"],
83479
- ["@uipath/agent-tool", "agent"],
83480
- ["@uipath/codedagent-tool", "codedagent"],
83481
- ["@uipath/codedapp-tool", "codedapp"],
83482
- ["@uipath/integrationservice-tool", "is"],
83483
- ["@uipath/orchestrator-tool", "or"],
83484
- ["@uipath/rpa-tool", "rpa"],
83485
- ["@uipath/flow-tool", "flow"],
83486
- ["@uipath/case-tool", "case"],
83487
- ["@uipath/test-manager-tool", "tm"],
83488
- ["@uipath/resource-tool", "resource"],
83489
- ["@uipath/api-workflow-tool", "api-workflow"],
83490
- ["@uipath/maestro-tool", "maestro"],
83491
- ["@uipath/docsai-tool", "docsai"],
83492
- ["@uipath/vertical-solutions-tool", "vss"],
83493
- ["@uipath/traces-tool", "traces"]
83494
- ]);
83495
- WHITELIST_BY_COMMAND = new Map([...TOOLS_WHITELIST.entries()].map(([pkg, cmd]) => [cmd, pkg]));
83496
- WHITELIST_BY_SHORT_NAME = new Map([...TOOLS_WHITELIST.keys()].map((pkg) => [
83497
- pkg.replace(/^@uipath\//, ""),
83498
- pkg
83499
- ]));
83500
83407
  toolService = new NodeToolService;
83501
83408
  });
83502
83409
 
@@ -83826,22 +83733,22 @@ var init_tools = __esm(() => {
83826
83733
  function createInstallPathResolver(toolsDir, isBrowser3) {
83827
83734
  return async (packageName) => {
83828
83735
  if (isBrowser3) {
83829
- const path3 = packageName ? `/tools/${packageName.replace(/[/@]/g, "_")}` : "/tools";
83830
- return { path: path3, global: false };
83736
+ const path4 = packageName ? `/tools/${packageName.replace(/[/@]/g, "_")}` : "/tools";
83737
+ return { path: path4, global: false };
83831
83738
  }
83832
83739
  const { getFileSystem: getFileSystem2 } = await Promise.resolve().then(() => (init_src2(), exports_src));
83833
83740
  const fsLocal = getFileSystem2();
83834
83741
  const { dirname: dirnameFn, join: joinFn } = fsLocal.path;
83835
83742
  if (toolsDir) {
83836
- let path3 = dirnameFn(dirnameFn(toolsDir));
83837
- while (insideNodeModules(path3)) {
83838
- const parent = dirnameFn(path3);
83839
- if (parent === path3)
83743
+ let path4 = dirnameFn(dirnameFn(toolsDir));
83744
+ while (insideNodeModules(path4)) {
83745
+ const parent = dirnameFn(path4);
83746
+ if (parent === path4)
83840
83747
  break;
83841
- path3 = parent;
83748
+ path4 = parent;
83842
83749
  }
83843
83750
  let isGlobal = true;
83844
- const pkgJsonPath = joinFn(path3, "package.json");
83751
+ const pkgJsonPath = joinFn(path4, "package.json");
83845
83752
  if (await fsLocal.exists(pkgJsonPath)) {
83846
83753
  const [, raw] = await catchError(fsLocal.readFile(pkgJsonPath, "utf-8"));
83847
83754
  if (raw) {
@@ -83860,8 +83767,8 @@ function createInstallPathResolver(toolsDir, isBrowser3) {
83860
83767
  }
83861
83768
  }
83862
83769
  }
83863
- logger.debug(`Install path resolved: ${path3} (global: ${isGlobal})`);
83864
- return { path: path3, global: isGlobal };
83770
+ logger.debug(`Install path resolved: ${path4} (global: ${isGlobal})`);
83771
+ return { path: path4, global: isGlobal };
83865
83772
  }
83866
83773
  let searchDir = fsLocal.env.cwd();
83867
83774
  for (let i2 = 0;i2 < 10; i2++) {
@@ -83902,8 +83809,8 @@ class GeneralizedStorage {
83902
83809
  get fs() {
83903
83810
  return getFileSystem();
83904
83811
  }
83905
- async read(path3) {
83906
- const res = await this.fs.readFile(path3);
83812
+ async read(path4) {
83813
+ const res = await this.fs.readFile(path4);
83907
83814
  if (res === null)
83908
83815
  return null;
83909
83816
  if (typeof res === "string") {
@@ -83911,25 +83818,25 @@ class GeneralizedStorage {
83911
83818
  }
83912
83819
  return res;
83913
83820
  }
83914
- async readText(path3) {
83915
- return this.fs.readFile(path3, "utf-8");
83821
+ async readText(path4) {
83822
+ return this.fs.readFile(path4, "utf-8");
83916
83823
  }
83917
- async write(path3, content) {
83918
- await this.fs.writeFile(path3, content);
83824
+ async write(path4, content) {
83825
+ await this.fs.writeFile(path4, content);
83919
83826
  }
83920
- async exists(path3) {
83921
- return this.fs.exists(path3);
83827
+ async exists(path4) {
83828
+ return this.fs.exists(path4);
83922
83829
  }
83923
- async readdir(path3) {
83924
- return this.fs.readdir(path3);
83830
+ async readdir(path4) {
83831
+ return this.fs.readdir(path4);
83925
83832
  }
83926
- async remove(path3) {
83927
- if (!await this.fs.exists(path3))
83833
+ async remove(path4) {
83834
+ if (!await this.fs.exists(path4))
83928
83835
  return;
83929
- await this.fs.rm(path3);
83836
+ await this.fs.rm(path4);
83930
83837
  }
83931
- async mkdir(path3) {
83932
- await this.fs.mkdir(path3);
83838
+ async mkdir(path4) {
83839
+ await this.fs.mkdir(path4);
83933
83840
  }
83934
83841
  }
83935
83842
  var storage;
@@ -84543,15 +84450,16 @@ function buildTableHelpSections(cmd, helper) {
84543
84450
  Description: summarizeDescription(helper.subcommandDescription(subcommand) || "")
84544
84451
  }));
84545
84452
  if (isRootCommand(cmd)) {
84546
- const builtIns = subcommands.filter((subcommand) => BUILT_IN_ROOT_COMMANDS.has(subcommand.Key) && subcommand.Key !== "help");
84547
- const tools = subcommands.filter((subcommand) => !BUILT_IN_ROOT_COMMANDS.has(subcommand.Key));
84453
+ const builtIns = subcommands.filter((subcommand) => BUILT_IN_ROOT_COMMANDS.includes(subcommand.Key) && subcommand.Key !== "help");
84454
+ const tools = subcommands.filter((subcommand) => !BUILT_IN_ROOT_COMMANDS.includes(subcommand.Key));
84548
84455
  if (builtIns.length > 0) {
84456
+ builtIns.sort((a, b) => BUILT_IN_ROOT_COMMANDS.indexOf(a.Key) - BUILT_IN_ROOT_COMMANDS.indexOf(b.Key));
84549
84457
  sections.push({
84550
84458
  Title: "Commands",
84551
- Lines: renderRows(sortByLabel(builtIns.map(({ Label, Description }) => ({
84459
+ Lines: renderRows(builtIns.map(({ Label, Description }) => ({
84552
84460
  Label,
84553
84461
  Description
84554
- }))), contentWidth)
84462
+ })), contentWidth)
84555
84463
  });
84556
84464
  }
84557
84465
  if (tools.length > 0) {
@@ -84666,14 +84574,15 @@ var init_helpFormatter = __esm(() => {
84666
84574
  Description: "Write logs to file instead of stderr"
84667
84575
  }
84668
84576
  ];
84669
- BUILT_IN_ROOT_COMMANDS = new Set([
84670
- "help",
84577
+ BUILT_IN_ROOT_COMMANDS = [
84671
84578
  "login",
84672
84579
  "logout",
84673
- "mcp",
84580
+ "tools",
84674
84581
  "skills",
84675
- "tools"
84676
- ]);
84582
+ "mcp",
84583
+ "feedback",
84584
+ "help"
84585
+ ];
84677
84586
  });
84678
84587
 
84679
84588
  // src/telemetry-events.ts