@robinmordasiewicz/f5xc-xcsh 6.24.0 → 6.25.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 +15 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -45309,8 +45309,8 @@ function getLogoModeFromEnv(envPrefix) {
45309
45309
  var CLI_NAME = "xcsh";
45310
45310
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
45311
45311
  function getVersion() {
45312
- if ("6.24.0") {
45313
- return "6.24.0";
45312
+ if ("6.25.0") {
45313
+ return "6.25.0";
45314
45314
  }
45315
45315
  if (process.env.XCSH_VERSION) {
45316
45316
  return process.env.XCSH_VERSION;
@@ -52578,11 +52578,11 @@ function toUISuggestions(suggestions) {
52578
52578
  // Provide default to avoid undefined
52579
52579
  }));
52580
52580
  }
52581
- function App2() {
52581
+ function App2({ initialSession } = {}) {
52582
52582
  const { exit } = use_app_default();
52583
52583
  const { stdout } = use_stdout_default();
52584
- const [session] = (0, import_react28.useState)(() => new REPLSession());
52585
- const [isInitialized, setIsInitialized] = (0, import_react28.useState)(false);
52584
+ const [session] = (0, import_react28.useState)(() => initialSession ?? new REPLSession());
52585
+ const [isInitialized, setIsInitialized] = (0, import_react28.useState)(!!initialSession);
52586
52586
  const [input, setInputState] = (0, import_react28.useState)("");
52587
52587
  const inputRef = (0, import_react28.useRef)("");
52588
52588
  const setInput = (0, import_react28.useCallback)(
@@ -52637,13 +52637,15 @@ function App2() {
52637
52637
  });
52638
52638
  (0, import_react28.useEffect)(() => {
52639
52639
  const init = async () => {
52640
- await session.initialize();
52640
+ if (!isInitialized) {
52641
+ await session.initialize();
52642
+ setIsInitialized(true);
52643
+ }
52641
52644
  setPrompt(buildPlainPrompt(session));
52642
52645
  const histMgr = session.getHistory();
52643
52646
  if (histMgr) {
52644
52647
  setHistoryArray(histMgr.getHistory());
52645
52648
  }
52646
- setIsInitialized(true);
52647
52649
  setGitInfo(getGitInfo());
52648
52650
  };
52649
52651
  init();
@@ -52939,9 +52941,14 @@ program2.name(CLI_NAME).description("F5 Distributed Cloud Shell - Interactive CL
52939
52941
  process.exit(1);
52940
52942
  }
52941
52943
  const cliLogoMode = options.logo && isValidLogoMode(options.logo) ? options.logo : void 0;
52944
+ process.stdout.write("Initializing...");
52945
+ const session = new REPLSession();
52946
+ await session.initialize();
52947
+ process.stdout.write("\r\x1B[K");
52942
52948
  renderBanner(cliLogoMode, "startup");
52943
52949
  process.stdin.resume();
52944
- render_default(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(App2, {}));
52950
+ const appProps = { initialSession: session };
52951
+ render_default(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(App2, { ...appProps }));
52945
52952
  return;
52946
52953
  }
52947
52954
  await executeNonInteractive(commandArgs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "6.24.0",
3
+ "version": "6.25.0",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {