@robinmordasiewicz/f5xc-xcsh 2.0.21-2601091926 → 2.0.21-2601100343

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 +55 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -48639,8 +48639,8 @@ function getLogoModeFromEnv(envPrefix) {
48639
48639
  var CLI_NAME = "xcsh";
48640
48640
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
48641
48641
  function getVersion() {
48642
- if ("v2.0.21-2601091926") {
48643
- return "v2.0.21-2601091926";
48642
+ if ("v2.0.21-2601100343") {
48643
+ return "v2.0.21-2601100343";
48644
48644
  }
48645
48645
  if (process.env.XCSH_VERSION) {
48646
48646
  return process.env.XCSH_VERSION;
@@ -49207,7 +49207,8 @@ var APIClient = class {
49207
49207
  */
49208
49208
  async executeRequest(options, url, headers, body) {
49209
49209
  const controller = new AbortController();
49210
- const timeoutId = setTimeout(() => controller.abort(), this.timeout);
49210
+ const requestTimeout = options.timeout ?? this.timeout;
49211
+ const timeoutId = setTimeout(() => controller.abort(), requestTimeout);
49211
49212
  try {
49212
49213
  const response = await fetch(url, {
49213
49214
  method: options.method,
@@ -49253,7 +49254,7 @@ var APIClient = class {
49253
49254
  }
49254
49255
  if (error instanceof Error && error.name === "AbortError") {
49255
49256
  throw new APIError(
49256
- `Request timed out after ${this.timeout}ms`,
49257
+ `Request timed out after ${requestTimeout}ms`,
49257
49258
  408,
49258
49259
  void 0,
49259
49260
  `${options.method} ${options.path}`
@@ -49338,7 +49339,7 @@ var APIClient = class {
49338
49339
  /**
49339
49340
  * POST request
49340
49341
  */
49341
- async post(path, body) {
49342
+ async post(path, body, timeout) {
49342
49343
  const options = {
49343
49344
  method: "POST",
49344
49345
  path
@@ -49346,6 +49347,9 @@ var APIClient = class {
49346
49347
  if (body) {
49347
49348
  options.body = body;
49348
49349
  }
49350
+ if (timeout !== void 0) {
49351
+ options.timeout = timeout;
49352
+ }
49349
49353
  return this.request(options);
49350
49354
  }
49351
49355
  /**
@@ -75302,17 +75306,30 @@ var REPLSession = class {
75302
75306
  * Initialize the session (async operations)
75303
75307
  */
75304
75308
  async initialize() {
75309
+ const startTime = Date.now();
75310
+ const profile = (label) => {
75311
+ if (this._debug || process.env.XCSH_PROFILE === "true") {
75312
+ console.error(
75313
+ `[PROFILE] ${label}: ${Date.now() - startTime}ms`
75314
+ );
75315
+ }
75316
+ };
75317
+ profile("initialize:start");
75305
75318
  try {
75306
75319
  this._history = await HistoryManager.create(
75307
75320
  getHistoryFilePath(),
75308
75321
  1e3
75309
75322
  );
75323
+ profile("history:loaded");
75310
75324
  } catch (error) {
75311
75325
  console.error("Warning: could not initialize history:", error);
75312
75326
  this._history = new HistoryManager(getHistoryFilePath(), 1e3);
75327
+ profile("history:fallback");
75313
75328
  }
75314
75329
  await this.loadActiveProfile();
75330
+ profile("profile:loaded");
75315
75331
  if (this._apiClient?.isAuthenticated()) {
75332
+ profile("token_validation:start");
75316
75333
  debugProtocol.auth("token_validation_start", {
75317
75334
  serverUrl: this._serverUrl,
75318
75335
  hasApiClient: true,
@@ -75321,6 +75338,7 @@ var REPLSession = class {
75321
75338
  const result = await this._apiClient.validateToken();
75322
75339
  this._tokenValidated = result.valid;
75323
75340
  this._validationError = result.error ?? null;
75341
+ profile("token_validation:complete");
75324
75342
  debugProtocol.auth("token_validation_complete", {
75325
75343
  valid: result.valid,
75326
75344
  error: result.error,
@@ -75348,7 +75366,9 @@ var REPLSession = class {
75348
75366
  apiToken: this._apiToken,
75349
75367
  debug: this._debug
75350
75368
  });
75369
+ profile("fallback_validation:start");
75351
75370
  const fallbackResult = await this._apiClient.validateToken();
75371
+ profile("fallback_validation:complete");
75352
75372
  if (fallbackResult.valid) {
75353
75373
  this._tokenValidated = true;
75354
75374
  this._validationError = null;
@@ -75384,9 +75404,12 @@ var REPLSession = class {
75384
75404
  }
75385
75405
  }
75386
75406
  if (this._tokenValidated) {
75407
+ profile("user_info:start");
75387
75408
  await this.fetchUserInfo();
75409
+ profile("user_info:complete");
75388
75410
  }
75389
75411
  }
75412
+ profile("initialize:complete");
75390
75413
  }
75391
75414
  /**
75392
75415
  * Fetch user info from the API
@@ -76159,6 +76182,7 @@ function Spinner({ type = "dots" }) {
76159
76182
  var build_default2 = Spinner;
76160
76183
 
76161
76184
  // src/domains/ai_services/client.ts
76185
+ var GENAI_QUERY_TIMEOUT = 6e4;
76162
76186
  var GenAIClient = class {
76163
76187
  constructor(apiClient) {
76164
76188
  this.apiClient = apiClient;
@@ -76177,7 +76201,8 @@ var GenAIClient = class {
76177
76201
  };
76178
76202
  const response = await this.apiClient.post(
76179
76203
  `/api/gen-ai/namespaces/${namespace}/query`,
76180
- request
76204
+ request,
76205
+ GENAI_QUERY_TIMEOUT
76181
76206
  );
76182
76207
  if (!response.ok) {
76183
76208
  throw new Error(
@@ -76216,7 +76241,8 @@ var GenAIClient = class {
76216
76241
  };
76217
76242
  const response = await this.apiClient.post(
76218
76243
  `/api/gen-ai/namespaces/${namespace}/eval_query`,
76219
- request
76244
+ request,
76245
+ GENAI_QUERY_TIMEOUT
76220
76246
  );
76221
76247
  if (!response.ok) {
76222
76248
  throw new Error(
@@ -85465,7 +85491,29 @@ var HeadlessController = class {
85465
85491
 
85466
85492
  // src/index.tsx
85467
85493
  var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
85494
+ var _startupTime = Date.now();
85495
+ var _profile = (label) => {
85496
+ if (process.env.XCSH_PROFILE === "true") {
85497
+ console.error(`[STARTUP] ${label}: ${Date.now() - _startupTime}ms`);
85498
+ }
85499
+ };
85500
+ _profile("script:start");
85501
+ _profile("import:ink");
85502
+ _profile("import:commander");
85503
+ _profile("import:repl");
85504
+ _profile("import:branding");
85505
+ _profile("import:executor");
85506
+ _profile("import:session");
85507
+ _profile("import:help");
85508
+ _profile("import:config");
85509
+ _profile("import:output-types");
85510
+ _profile("import:banner");
85511
+ _profile("import:debug");
85512
+ _profile("import:spec");
85513
+ _profile("import:headless");
85514
+ _profile("imports:complete");
85468
85515
  var program2 = new Command();
85516
+ _profile("commander:created");
85469
85517
  program2.configureHelp({
85470
85518
  formatHelp: () => formatRootHelp().join("\n")
85471
85519
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "2.0.21-2601091926",
3
+ "version": "2.0.21-2601100343",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {