@lobehub/cli 0.0.197 → 0.0.198

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
@@ -15,7 +15,7 @@ import { Buffer as Buffer$1 } from "node:buffer";
15
15
  import * as net$1 from "node:net";
16
16
  import net, { BlockList, connect, createServer, isIP } from "node:net";
17
17
  import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
18
- import process$1, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
18
+ import _w, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
19
19
  import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
20
20
  import { finished, pipeline } from "node:stream/promises";
21
21
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark, pipeline as pipeline$1 } from "node:stream";
@@ -24432,7 +24432,7 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
24432
24432
  const childProcess$2 = __require("node:child_process");
24433
24433
  const path$16 = __require("node:path");
24434
24434
  const fs$17 = __require("node:fs");
24435
- const process$3 = __require("node:process");
24435
+ const process$2 = __require("node:process");
24436
24436
  const { Argument, humanReadableArgName } = require_argument();
24437
24437
  const { CommanderError } = require_error$1();
24438
24438
  const { Help, stripColor } = require_help();
@@ -24484,13 +24484,13 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
24484
24484
  this._showSuggestionAfterError = true;
24485
24485
  this._savedState = null;
24486
24486
  this._outputConfiguration = {
24487
- writeOut: (str) => process$3.stdout.write(str),
24488
- writeErr: (str) => process$3.stderr.write(str),
24487
+ writeOut: (str) => process$2.stdout.write(str),
24488
+ writeErr: (str) => process$2.stderr.write(str),
24489
24489
  outputError: (str, write) => write(str),
24490
- getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
24491
- getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
24492
- getOutHasColors: () => useColor() ?? (process$3.stdout.isTTY && process$3.stdout.hasColors?.()),
24493
- getErrHasColors: () => useColor() ?? (process$3.stderr.isTTY && process$3.stderr.hasColors?.()),
24490
+ getOutHelpWidth: () => process$2.stdout.isTTY ? process$2.stdout.columns : void 0,
24491
+ getErrHelpWidth: () => process$2.stderr.isTTY ? process$2.stderr.columns : void 0,
24492
+ getOutHasColors: () => useColor() ?? (process$2.stdout.isTTY && process$2.stdout.hasColors?.()),
24493
+ getErrHasColors: () => useColor() ?? (process$2.stderr.isTTY && process$2.stderr.hasColors?.()),
24494
24494
  stripColor: (str) => stripColor(str)
24495
24495
  };
24496
24496
  this._hidden = false;
@@ -24848,7 +24848,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
24848
24848
  */
24849
24849
  _exit(exitCode, code, message) {
24850
24850
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code, message));
24851
- process$3.exit(exitCode);
24851
+ process$2.exit(exitCode);
24852
24852
  }
24853
24853
  /**
24854
24854
  * Register callback `fn` for the command.
@@ -25187,11 +25187,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
25187
25187
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
25188
25188
  parseOptions = parseOptions || {};
25189
25189
  if (argv === void 0 && parseOptions.from === void 0) {
25190
- if (process$3.versions?.electron) parseOptions.from = "electron";
25191
- const execArgv = process$3.execArgv ?? [];
25190
+ if (process$2.versions?.electron) parseOptions.from = "electron";
25191
+ const execArgv = process$2.execArgv ?? [];
25192
25192
  if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) parseOptions.from = "eval";
25193
25193
  }
25194
- if (argv === void 0) argv = process$3.argv;
25194
+ if (argv === void 0) argv = process$2.argv;
25195
25195
  this.rawArgs = argv.slice();
25196
25196
  let userArgs;
25197
25197
  switch (parseOptions.from) {
@@ -25201,7 +25201,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
25201
25201
  userArgs = argv.slice(2);
25202
25202
  break;
25203
25203
  case "electron":
25204
- if (process$3.defaultApp) {
25204
+ if (process$2.defaultApp) {
25205
25205
  this._scriptPath = argv[1];
25206
25206
  userArgs = argv.slice(2);
25207
25207
  } else userArgs = argv.slice(1);
@@ -25366,16 +25366,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
25366
25366
  }
25367
25367
  launchWithNode = sourceExt.includes(path$16.extname(executableFile));
25368
25368
  let proc;
25369
- if (process$3.platform !== "win32") if (launchWithNode) {
25369
+ if (process$2.platform !== "win32") if (launchWithNode) {
25370
25370
  args.unshift(executableFile);
25371
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
25372
- proc = childProcess$2.spawn(process$3.argv[0], args, { stdio: "inherit" });
25371
+ args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
25372
+ proc = childProcess$2.spawn(process$2.argv[0], args, { stdio: "inherit" });
25373
25373
  } else proc = childProcess$2.spawn(executableFile, args, { stdio: "inherit" });
25374
25374
  else {
25375
25375
  this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
25376
25376
  args.unshift(executableFile);
25377
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
25378
- proc = childProcess$2.spawn(process$3.execPath, args, { stdio: "inherit" });
25377
+ args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
25378
+ proc = childProcess$2.spawn(process$2.execPath, args, { stdio: "inherit" });
25379
25379
  }
25380
25380
  if (!proc.killed) [
25381
25381
  "SIGUSR1",
@@ -25384,20 +25384,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
25384
25384
  "SIGINT",
25385
25385
  "SIGHUP"
25386
25386
  ].forEach((signal) => {
25387
- process$3.on(signal, () => {
25387
+ process$2.on(signal, () => {
25388
25388
  if (proc.killed === false && proc.exitCode === null) proc.kill(signal);
25389
25389
  });
25390
25390
  });
25391
25391
  const exitCallback = this._exitCallback;
25392
25392
  proc.on("close", (code) => {
25393
25393
  code = code ?? 1;
25394
- if (!exitCallback) process$3.exit(code);
25394
+ if (!exitCallback) process$2.exit(code);
25395
25395
  else exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
25396
25396
  });
25397
25397
  proc.on("error", (err) => {
25398
25398
  if (err.code === "ENOENT") this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
25399
25399
  else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
25400
- if (!exitCallback) process$3.exit(1);
25400
+ if (!exitCallback) process$2.exit(1);
25401
25401
  else {
25402
25402
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
25403
25403
  wrappedError.nestedError = err;
@@ -25806,13 +25806,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
25806
25806
  */
25807
25807
  _parseOptionsEnv() {
25808
25808
  this.options.forEach((option) => {
25809
- if (option.envVar && option.envVar in process$3.env) {
25809
+ if (option.envVar && option.envVar in process$2.env) {
25810
25810
  const optionKey = option.attributeName();
25811
25811
  if (this.getOptionValue(optionKey) === void 0 || [
25812
25812
  "default",
25813
25813
  "config",
25814
25814
  "env"
25815
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
25815
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$2.env[option.envVar]);
25816
25816
  else this.emit(`optionEnv:${option.name()}`);
25817
25817
  }
25818
25818
  });
@@ -26229,7 +26229,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
26229
26229
  */
26230
26230
  help(contextOptions) {
26231
26231
  this.outputHelp(contextOptions);
26232
- let exitCode = Number(process$3.exitCode ?? 0);
26232
+ let exitCode = Number(process$2.exitCode ?? 0);
26233
26233
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
26234
26234
  this._exit(exitCode, "commander.help", "(outputHelp)");
26235
26235
  }
@@ -26319,8 +26319,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
26319
26319
  * @package
26320
26320
  */
26321
26321
  function useColor() {
26322
- if (process$3.env.NO_COLOR || process$3.env.FORCE_COLOR === "0" || process$3.env.FORCE_COLOR === "false") return false;
26323
- if (process$3.env.FORCE_COLOR || process$3.env.CLICOLOR_FORCE !== void 0) return true;
26322
+ if (process$2.env.NO_COLOR || process$2.env.FORCE_COLOR === "0" || process$2.env.FORCE_COLOR === "false") return false;
26323
+ if (process$2.env.FORCE_COLOR || process$2.env.CLICOLOR_FORCE !== void 0) return true;
26324
26324
  }
26325
26325
  exports.Command = Command;
26326
26326
  exports.useColor = useColor;
@@ -99768,18 +99768,24 @@ var require_word = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
99768
99768
 
99769
99769
  //#endregion
99770
99770
  //#region ../../packages/file-loaders/src/loaders/doc/index.ts
99771
- var doc_exports = /* @__PURE__ */ __exportAll$2({ DocLoader: () => DocLoader });
99772
- var import_src$4, import_word, log$11, DocLoader;
99771
+ var doc_exports = /* @__PURE__ */ __exportAll$2({
99772
+ DocLoader: () => DocLoader,
99773
+ extractDocText: () => extractDocText
99774
+ });
99775
+ var import_src$4, import_word, log$11, extractDocText, DocLoader;
99773
99776
  var init_doc = __esmMin((() => {
99774
99777
  import_src$4 = /* @__PURE__ */ __toESM$2(require_src());
99775
99778
  import_word = /* @__PURE__ */ __toESM$2(require_word());
99776
99779
  log$11 = (0, import_src$4.default)("file-loaders:doc");
99780
+ extractDocText = async (source) => {
99781
+ const extracted = await new import_word.default().extract(source);
99782
+ return typeof extracted?.getBody === "function" ? extracted.getBody() : extracted?.text ?? "";
99783
+ };
99777
99784
  DocLoader = class {
99778
99785
  async loadPages(filePath) {
99779
99786
  log$11("Loading DOC file:", filePath);
99780
99787
  try {
99781
- const extracted = await new import_word.default().extract(filePath);
99782
- const pageContent = extracted && typeof extracted.getBody === "function" ? extracted.getBody() : extracted?.text ?? "";
99788
+ const pageContent = await extractDocText(filePath);
99783
99789
  const lineCount = pageContent.split("\n").length;
99784
99790
  const page = {
99785
99791
  charCount: pageContent.length,
@@ -337531,7 +337537,7 @@ var stdio_exports = /* @__PURE__ */ __exportAll$2({
337531
337537
  function getDefaultEnvironment() {
337532
337538
  const env = {};
337533
337539
  for (const key of DEFAULT_INHERITED_ENV_VARS) {
337534
- const value = process$1.env[key];
337540
+ const value = _w.env[key];
337535
337541
  if (value === void 0) continue;
337536
337542
  if (value.startsWith("()")) continue;
337537
337543
  env[key] = value;
@@ -337542,7 +337548,7 @@ var import_cross_spawn$1, DEFAULT_INHERITED_ENV_VARS, StdioClientTransport;
337542
337548
  var init_stdio = __esmMin((() => {
337543
337549
  init_src_CeKsbNLO();
337544
337550
  import_cross_spawn$1 = /* @__PURE__ */ __toESM$2(require_cross_spawn(), 1);
337545
- DEFAULT_INHERITED_ENV_VARS = process$1.platform === "win32" ? [
337551
+ DEFAULT_INHERITED_ENV_VARS = _w.platform === "win32" ? [
337546
337552
  "APPDATA",
337547
337553
  "COMSPEC",
337548
337554
  "HOMEDRIVE",
@@ -337599,7 +337605,7 @@ var init_stdio = __esmMin((() => {
337599
337605
  this._serverParams.stderr ?? "inherit"
337600
337606
  ],
337601
337607
  shell: false,
337602
- windowsHide: process$1.platform === "win32",
337608
+ windowsHide: _w.platform === "win32",
337603
337609
  cwd: this._serverParams.cwd
337604
337610
  });
337605
337611
  this._process.on("error", (error) => {
@@ -340633,9 +340639,9 @@ const getSubprocessResult = ({ stdout }) => {
340633
340639
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/utils/standard-stream.js
340634
340640
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
340635
340641
  const STANDARD_STREAMS = [
340636
- process$1.stdin,
340637
- process$1.stdout,
340638
- process$1.stderr
340642
+ _w.stdin,
340643
+ _w.stdout,
340644
+ _w.stderr
340639
340645
  ];
340640
340646
  const STANDARD_STREAMS_ALIASES = [
340641
340647
  "stdin",
@@ -340760,9 +340766,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
340760
340766
  //#endregion
340761
340767
  //#region node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
340762
340768
  function isUnicodeSupported() {
340763
- const { env } = process$1;
340769
+ const { env } = _w;
340764
340770
  const { TERM, TERM_PROGRAM } = env;
340765
- if (process$1.platform !== "win32") return TERM !== "linux";
340771
+ if (_w.platform !== "win32") return TERM !== "linux";
340766
340772
  return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
340767
340773
  }
340768
340774
 
@@ -341297,7 +341303,7 @@ function traversePathUp(startPath) {
341297
341303
 
341298
341304
  //#endregion
341299
341305
  //#region node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
341300
- const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath = process$1.execPath, addExecPath = true } = {}) => {
341306
+ const npmRunPath = ({ cwd = _w.cwd(), path: pathOption = _w.env[pathKey()], preferLocal = true, execPath = _w.execPath, addExecPath = true } = {}) => {
341301
341307
  const cwdPath = path.resolve(toPath(cwd));
341302
341308
  const result = [];
341303
341309
  const pathParts = pathOption.split(path.delimiter);
@@ -341315,7 +341321,7 @@ const applyExecPath = (result, pathParts, execPath, cwdPath) => {
341315
341321
  const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
341316
341322
  if (!pathParts.includes(pathPart)) result.push(pathPart);
341317
341323
  };
341318
- const npmRunPathEnv = ({ env = process$1.env, ...options } = {}) => {
341324
+ const npmRunPathEnv = ({ env = _w.env, ...options } = {}) => {
341319
341325
  env = { ...env };
341320
341326
  const pathName = pathKey({ env });
341321
341327
  options.path = env[pathName];
@@ -342450,7 +342456,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
342450
342456
  };
342451
342457
  const getDefaultCwd = () => {
342452
342458
  try {
342453
- return process$1.cwd();
342459
+ return _w.cwd();
342454
342460
  } catch (error) {
342455
342461
  error.message = `The current directory does not exist.\n${error.message}`;
342456
342462
  throw error;
@@ -342486,7 +342492,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
342486
342492
  options.killSignal = normalizeKillSignal(options.killSignal);
342487
342493
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
342488
342494
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
342489
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
342495
+ if (_w.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
342490
342496
  return {
342491
342497
  file,
342492
342498
  commandArguments,
@@ -342513,7 +342519,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
342513
342519
  });
342514
342520
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
342515
342521
  const env = extendEnv ? {
342516
- ...process$1.env,
342522
+ ..._w.env,
342517
342523
  ...envOption
342518
342524
  } : envOption;
342519
342525
  if (preferLocal || node) return npmRunPathEnv({
@@ -343515,12 +343521,12 @@ const guessStreamDirection = {
343515
343521
  }
343516
343522
  };
343517
343523
  const getStandardStreamDirection = (value) => {
343518
- if ([0, process$1.stdin].includes(value)) return "input";
343524
+ if ([0, _w.stdin].includes(value)) return "input";
343519
343525
  if ([
343520
343526
  1,
343521
343527
  2,
343522
- process$1.stdout,
343523
- process$1.stderr
343528
+ _w.stdout,
343529
+ _w.stderr
343524
343530
  ].includes(value)) return "output";
343525
343531
  };
343526
343532
  const DEFAULT_DIRECTION = "output";
@@ -344584,9 +344590,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
344584
344590
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
344585
344591
  };
344586
344592
  const getIpcExport = () => {
344587
- const anyProcess = process$1;
344593
+ const anyProcess = _w;
344588
344594
  const isSubprocess = true;
344589
- const ipc = process$1.channel !== void 0;
344595
+ const ipc = _w.channel !== void 0;
344590
344596
  return {
344591
344597
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
344592
344598
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -345063,7 +345069,7 @@ var SignalExitFallback = class extends SignalExitBase {
345063
345069
  };
345064
345070
  var SignalExit = class extends SignalExitBase {
345065
345071
  /* c8 ignore start */
345066
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
345072
+ #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
345067
345073
  /* c8 ignore stop */
345068
345074
  #emitter = new Emitter();
345069
345075
  #process;
@@ -345158,8 +345164,8 @@ var SignalExit = class extends SignalExitBase {
345158
345164
  } else return og.call(this.#process, ev, ...args);
345159
345165
  }
345160
345166
  };
345161
- const process$2 = globalThis.process;
345162
- const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
345167
+ const process$1 = globalThis.process;
345168
+ const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
345163
345169
 
345164
345170
  //#endregion
345165
345171
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/terminate/cleanup.js
package/man/man1/lh.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .\" Code generated by `npm run man:generate`; DO NOT EDIT.
2
2
  .\" Manual command details come from the Commander command tree.
3
- .TH LH 1 "" "@lobehub/cli 0.0.197" "User Commands"
3
+ .TH LH 1 "" "@lobehub/cli 0.0.198" "User Commands"
4
4
  .SH NAME
5
5
  lh \- LobeHub CLI \- manage and connect to LobeHub services
6
6
  .SH SYNOPSIS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/cli",
3
- "version": "0.0.197",
3
+ "version": "0.0.198",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/lobehub/lobehub",
@@ -83,5 +83,5 @@
83
83
  "access": "public",
84
84
  "registry": "https://registry.npmjs.org"
85
85
  },
86
- "gitHead": "474865d3b2d36915ee224e97bdf4a4fc773be56c"
86
+ "gitHead": "f31fd954f70f0c64ee9b210cfbc7fee5c09cc87b"
87
87
  }