@robinmordasiewicz/f5xc-xcsh 1.0.82-2601010009 → 1.0.82-2601010623

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 +76 -29
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -43592,8 +43592,8 @@ var Ink = class {
43592
43592
  unsubscribeExit = () => {
43593
43593
  };
43594
43594
  calculateLayout = () => {
43595
- const terminalWidth = this.options.stdout.columns || 80;
43596
- this.rootNode.yogaNode.setWidth(terminalWidth);
43595
+ const terminalWidth2 = this.options.stdout.columns || 80;
43596
+ this.rootNode.yogaNode.setWidth(terminalWidth2);
43597
43597
  this.rootNode.yogaNode.calculateLayout(void 0, void 0, src_default.DIRECTION_LTR);
43598
43598
  };
43599
43599
  onRender = () => {
@@ -45009,8 +45009,50 @@ var ContextValidator = class {
45009
45009
 
45010
45010
  // src/repl/history.ts
45011
45011
  import { readFileSync as readFileSync2, writeFileSync, mkdirSync, existsSync as existsSync2 } from "fs";
45012
+ import { dirname } from "path";
45013
+
45014
+ // src/config/paths.ts
45012
45015
  import { homedir } from "os";
45013
- import { join, dirname } from "path";
45016
+ import { join } from "path";
45017
+ var APP_NAME = "xcsh";
45018
+ function getConfigDir() {
45019
+ const xdgConfig = process.env.XDG_CONFIG_HOME;
45020
+ if (xdgConfig) {
45021
+ return join(xdgConfig, APP_NAME);
45022
+ }
45023
+ return join(homedir(), ".config", APP_NAME);
45024
+ }
45025
+ function getStateDir() {
45026
+ const xdgState = process.env.XDG_STATE_HOME;
45027
+ if (xdgState) {
45028
+ return join(xdgState, APP_NAME);
45029
+ }
45030
+ return join(homedir(), ".local", "state", APP_NAME);
45031
+ }
45032
+ var paths = {
45033
+ // Config files (XDG_CONFIG_HOME)
45034
+ get configDir() {
45035
+ return getConfigDir();
45036
+ },
45037
+ get profilesDir() {
45038
+ return join(getConfigDir(), "profiles");
45039
+ },
45040
+ get activeProfile() {
45041
+ return join(getConfigDir(), "active_profile");
45042
+ },
45043
+ get settings() {
45044
+ return join(getConfigDir(), "config.yaml");
45045
+ },
45046
+ // State files (XDG_STATE_HOME)
45047
+ get stateDir() {
45048
+ return getStateDir();
45049
+ },
45050
+ get history() {
45051
+ return join(getStateDir(), "history");
45052
+ }
45053
+ };
45054
+
45055
+ // src/repl/history.ts
45014
45056
  var SENSITIVE_PATTERNS = [
45015
45057
  // Flag-based patterns: --flag value or --flag=value (capture flag and separator separately)
45016
45058
  {
@@ -45047,11 +45089,7 @@ function redactSensitive(cmd) {
45047
45089
  return redacted;
45048
45090
  }
45049
45091
  function getHistoryFilePath() {
45050
- try {
45051
- return join(homedir(), ".xcsh_history");
45052
- } catch {
45053
- return ".xcsh_history";
45054
- }
45092
+ return paths.history;
45055
45093
  }
45056
45094
  var HistoryManager = class _HistoryManager {
45057
45095
  path;
@@ -45354,8 +45392,8 @@ function getLogoModeFromEnv(envPrefix) {
45354
45392
  var CLI_NAME = "xcsh";
45355
45393
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
45356
45394
  function getVersion() {
45357
- if ("v1.0.82-2601010009") {
45358
- return "v1.0.82-2601010009";
45395
+ if ("v1.0.82-2601010623") {
45396
+ return "v1.0.82-2601010623";
45359
45397
  }
45360
45398
  if (process.env.XCSH_VERSION) {
45361
45399
  return process.env.XCSH_VERSION;
@@ -45367,7 +45405,6 @@ var cliDescs = getCliDescriptions();
45367
45405
  var CLI_DESCRIPTION_SHORT = cliDescs?.short ?? "Navigate cloud services via interactive shell";
45368
45406
  var CLI_DESCRIPTION_MEDIUM = cliDescs?.medium ?? CLI_DESCRIPTION_SHORT;
45369
45407
  var CLI_DESCRIPTION_LONG = cliDescs?.long ?? CLI_DESCRIPTION_MEDIUM;
45370
- var CONFIG_FILE_NAME = ".xcshconfig";
45371
45408
  var ENV_PREFIX = "F5XC";
45372
45409
  var F5_LOGO = ` ________
45373
45410
  (\u2592\u2592\u2592\u2592\u2593\u2593\u2593\u2593\u2593\u2593\u2593\u2593\u2592\u2592\u2592\u2592)
@@ -45424,7 +45461,6 @@ function colorDim(text) {
45424
45461
  // src/profile/manager.ts
45425
45462
  var import_yaml = __toESM(require_dist(), 1);
45426
45463
  import { promises as fs2 } from "fs";
45427
- import { homedir as homedir2 } from "os";
45428
45464
  import { join as join2 } from "path";
45429
45465
  function snakeToCamel(str) {
45430
45466
  return str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
@@ -45436,21 +45472,13 @@ function convertKeysToCamelCase(obj) {
45436
45472
  }
45437
45473
  return result;
45438
45474
  }
45439
- function getConfigDir() {
45440
- const xdgConfig = process.env.XDG_CONFIG_HOME;
45441
- if (xdgConfig) {
45442
- return join2(xdgConfig, "xcsh");
45443
- }
45444
- return join2(homedir2(), ".config", "xcsh");
45445
- }
45446
45475
  var ProfileManager = class {
45447
45476
  config;
45448
45477
  constructor() {
45449
- const configDir = getConfigDir();
45450
45478
  this.config = {
45451
- configDir,
45452
- profilesDir: join2(configDir, "profiles"),
45453
- activeProfileFile: join2(configDir, "active_profile")
45479
+ configDir: paths.configDir,
45480
+ profilesDir: paths.profilesDir,
45481
+ activeProfileFile: paths.activeProfile
45454
45482
  };
45455
45483
  }
45456
45484
  /**
@@ -46139,6 +46167,17 @@ function shouldUseColors(isTTY = process.stdout.isTTY ?? false, noColorFlag = fa
46139
46167
  return isTTY;
46140
46168
  }
46141
46169
 
46170
+ // src/output/terminal.ts
46171
+ var DEFAULT_WIDTH = 80;
46172
+ var MIN_WIDTH = 40;
46173
+ var terminalWidth = process.stdout.columns ?? DEFAULT_WIDTH;
46174
+ function getTerminalWidth() {
46175
+ return Math.max(terminalWidth, MIN_WIDTH);
46176
+ }
46177
+ function setTerminalWidth(width) {
46178
+ terminalWidth = Math.max(width, MIN_WIDTH);
46179
+ }
46180
+
46142
46181
  // src/output/table.ts
46143
46182
  var UNICODE_BOX = {
46144
46183
  topLeft: "\u256D",
@@ -46269,7 +46308,12 @@ function formatBeautifulTable(data, config, noColor = false) {
46269
46308
  const style = useColors ? config.style ?? DEFAULT_TABLE_STYLE : PLAIN_TABLE_STYLE;
46270
46309
  const box = getBoxCharacters(style);
46271
46310
  const borderColor = style.borderColor ?? colors.red;
46272
- const widths = calculateColumnWidths(config.columns, data, config.maxWidth);
46311
+ const effectiveMaxWidth = config.maxWidth ?? getTerminalWidth();
46312
+ const widths = calculateColumnWidths(
46313
+ config.columns,
46314
+ data,
46315
+ effectiveMaxWidth
46316
+ );
46273
46317
  const lines = [];
46274
46318
  const colorBorder = (text) => applyColor(text, borderColor, useColors && style.coloredBorders);
46275
46319
  const buildHorizontalLine = (left, mid, right, fill) => {
@@ -46588,7 +46632,7 @@ function formatEnvVarsSection() {
46588
46632
  function formatConfigSection() {
46589
46633
  return [
46590
46634
  "CONFIGURATION",
46591
- ` Config file: ~/${CONFIG_FILE_NAME}`,
46635
+ ` Config file: ${paths.settings}`,
46592
46636
  " Priority: CLI flags > environment variables > config file > defaults",
46593
46637
  "",
46594
46638
  "DOCUMENTATION",
@@ -49333,8 +49377,6 @@ var contextSubcommands = {
49333
49377
 
49334
49378
  // src/config/settings.ts
49335
49379
  var import_yaml3 = __toESM(require_dist(), 1);
49336
- import { homedir as homedir3 } from "os";
49337
- import { join as join3 } from "path";
49338
49380
  var LOGO_MODES = [
49339
49381
  {
49340
49382
  mode: "image",
@@ -49357,7 +49399,7 @@ function validateSettings(settings) {
49357
49399
  return validated;
49358
49400
  }
49359
49401
  function loadSettingsSync() {
49360
- const configPath = join3(homedir3(), CONFIG_FILE_NAME);
49402
+ const configPath = paths.settings;
49361
49403
  try {
49362
49404
  const content = __require("fs").readFileSync(
49363
49405
  configPath,
@@ -53383,9 +53425,14 @@ function App2({ initialSession } = {}) {
53383
53425
  (0, import_react28.useEffect)(() => {
53384
53426
  const handleResize = () => {
53385
53427
  if (stdout) {
53386
- setWidth(stdout.columns ?? 80);
53428
+ const newWidth = stdout.columns ?? 80;
53429
+ setWidth(newWidth);
53430
+ setTerminalWidth(newWidth);
53387
53431
  }
53388
53432
  };
53433
+ if (stdout) {
53434
+ setTerminalWidth(stdout.columns ?? 80);
53435
+ }
53389
53436
  stdout?.on("resize", handleResize);
53390
53437
  return () => {
53391
53438
  stdout?.off("resize", handleResize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "1.0.82-2601010009",
3
+ "version": "1.0.82-2601010623",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {