@lichao0223/lobehub-cli 0.0.78 → 0.0.80

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 _w, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
18
+ import process$1, { 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";
@@ -9790,6 +9790,7 @@ var init_fetch = __esmMin((() => {
9790
9790
  ShareTopicLimitExceeded: "ShareTopicLimitExceeded",
9791
9791
  ShareSpendLimitExceeded: "ShareSpendLimitExceeded",
9792
9792
  ShareHeterogeneousAgentUnsupported: "ShareHeterogeneousAgentUnsupported",
9793
+ ShareHeteroDeviceUnavailable: "ShareHeteroDeviceUnavailable",
9793
9794
  AgentShareProviderNotSupported: "AgentShareProviderNotSupported",
9794
9795
  SupervisorDecisionFailed: "SupervisorDecisionFailed",
9795
9796
  AgentConcurrencyLimitExceeded: "AgentConcurrencyLimitExceeded",
@@ -21912,7 +21913,7 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
21912
21913
  const childProcess$2 = __require("node:child_process");
21913
21914
  const path$16 = __require("node:path");
21914
21915
  const fs$17 = __require("node:fs");
21915
- const process$2 = __require("node:process");
21916
+ const process$3 = __require("node:process");
21916
21917
  const { Argument, humanReadableArgName } = require_argument();
21917
21918
  const { CommanderError } = require_error$1();
21918
21919
  const { Help, stripColor } = require_help();
@@ -21964,13 +21965,13 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
21964
21965
  this._showSuggestionAfterError = true;
21965
21966
  this._savedState = null;
21966
21967
  this._outputConfiguration = {
21967
- writeOut: (str) => process$2.stdout.write(str),
21968
- writeErr: (str) => process$2.stderr.write(str),
21968
+ writeOut: (str) => process$3.stdout.write(str),
21969
+ writeErr: (str) => process$3.stderr.write(str),
21969
21970
  outputError: (str, write) => write(str),
21970
- getOutHelpWidth: () => process$2.stdout.isTTY ? process$2.stdout.columns : void 0,
21971
- getErrHelpWidth: () => process$2.stderr.isTTY ? process$2.stderr.columns : void 0,
21972
- getOutHasColors: () => useColor() ?? (process$2.stdout.isTTY && process$2.stdout.hasColors?.()),
21973
- getErrHasColors: () => useColor() ?? (process$2.stderr.isTTY && process$2.stderr.hasColors?.()),
21971
+ getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
21972
+ getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
21973
+ getOutHasColors: () => useColor() ?? (process$3.stdout.isTTY && process$3.stdout.hasColors?.()),
21974
+ getErrHasColors: () => useColor() ?? (process$3.stderr.isTTY && process$3.stderr.hasColors?.()),
21974
21975
  stripColor: (str) => stripColor(str)
21975
21976
  };
21976
21977
  this._hidden = false;
@@ -22328,7 +22329,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22328
22329
  */
22329
22330
  _exit(exitCode, code, message) {
22330
22331
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code, message));
22331
- process$2.exit(exitCode);
22332
+ process$3.exit(exitCode);
22332
22333
  }
22333
22334
  /**
22334
22335
  * Register callback `fn` for the command.
@@ -22667,11 +22668,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
22667
22668
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
22668
22669
  parseOptions = parseOptions || {};
22669
22670
  if (argv === void 0 && parseOptions.from === void 0) {
22670
- if (process$2.versions?.electron) parseOptions.from = "electron";
22671
- const execArgv = process$2.execArgv ?? [];
22671
+ if (process$3.versions?.electron) parseOptions.from = "electron";
22672
+ const execArgv = process$3.execArgv ?? [];
22672
22673
  if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) parseOptions.from = "eval";
22673
22674
  }
22674
- if (argv === void 0) argv = process$2.argv;
22675
+ if (argv === void 0) argv = process$3.argv;
22675
22676
  this.rawArgs = argv.slice();
22676
22677
  let userArgs;
22677
22678
  switch (parseOptions.from) {
@@ -22681,7 +22682,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22681
22682
  userArgs = argv.slice(2);
22682
22683
  break;
22683
22684
  case "electron":
22684
- if (process$2.defaultApp) {
22685
+ if (process$3.defaultApp) {
22685
22686
  this._scriptPath = argv[1];
22686
22687
  userArgs = argv.slice(2);
22687
22688
  } else userArgs = argv.slice(1);
@@ -22846,16 +22847,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
22846
22847
  }
22847
22848
  launchWithNode = sourceExt.includes(path$16.extname(executableFile));
22848
22849
  let proc;
22849
- if (process$2.platform !== "win32") if (launchWithNode) {
22850
+ if (process$3.platform !== "win32") if (launchWithNode) {
22850
22851
  args.unshift(executableFile);
22851
- args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
22852
- proc = childProcess$2.spawn(process$2.argv[0], args, { stdio: "inherit" });
22852
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
22853
+ proc = childProcess$2.spawn(process$3.argv[0], args, { stdio: "inherit" });
22853
22854
  } else proc = childProcess$2.spawn(executableFile, args, { stdio: "inherit" });
22854
22855
  else {
22855
22856
  this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
22856
22857
  args.unshift(executableFile);
22857
- args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
22858
- proc = childProcess$2.spawn(process$2.execPath, args, { stdio: "inherit" });
22858
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
22859
+ proc = childProcess$2.spawn(process$3.execPath, args, { stdio: "inherit" });
22859
22860
  }
22860
22861
  if (!proc.killed) [
22861
22862
  "SIGUSR1",
@@ -22864,20 +22865,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
22864
22865
  "SIGINT",
22865
22866
  "SIGHUP"
22866
22867
  ].forEach((signal) => {
22867
- process$2.on(signal, () => {
22868
+ process$3.on(signal, () => {
22868
22869
  if (proc.killed === false && proc.exitCode === null) proc.kill(signal);
22869
22870
  });
22870
22871
  });
22871
22872
  const exitCallback = this._exitCallback;
22872
22873
  proc.on("close", (code) => {
22873
22874
  code = code ?? 1;
22874
- if (!exitCallback) process$2.exit(code);
22875
+ if (!exitCallback) process$3.exit(code);
22875
22876
  else exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
22876
22877
  });
22877
22878
  proc.on("error", (err) => {
22878
22879
  if (err.code === "ENOENT") this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
22879
22880
  else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
22880
- if (!exitCallback) process$2.exit(1);
22881
+ if (!exitCallback) process$3.exit(1);
22881
22882
  else {
22882
22883
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
22883
22884
  wrappedError.nestedError = err;
@@ -23286,13 +23287,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
23286
23287
  */
23287
23288
  _parseOptionsEnv() {
23288
23289
  this.options.forEach((option) => {
23289
- if (option.envVar && option.envVar in process$2.env) {
23290
+ if (option.envVar && option.envVar in process$3.env) {
23290
23291
  const optionKey = option.attributeName();
23291
23292
  if (this.getOptionValue(optionKey) === void 0 || [
23292
23293
  "default",
23293
23294
  "config",
23294
23295
  "env"
23295
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$2.env[option.envVar]);
23296
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
23296
23297
  else this.emit(`optionEnv:${option.name()}`);
23297
23298
  }
23298
23299
  });
@@ -23709,7 +23710,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
23709
23710
  */
23710
23711
  help(contextOptions) {
23711
23712
  this.outputHelp(contextOptions);
23712
- let exitCode = Number(process$2.exitCode ?? 0);
23713
+ let exitCode = Number(process$3.exitCode ?? 0);
23713
23714
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
23714
23715
  this._exit(exitCode, "commander.help", "(outputHelp)");
23715
23716
  }
@@ -23799,8 +23800,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
23799
23800
  * @package
23800
23801
  */
23801
23802
  function useColor() {
23802
- if (process$2.env.NO_COLOR || process$2.env.FORCE_COLOR === "0" || process$2.env.FORCE_COLOR === "false") return false;
23803
- if (process$2.env.FORCE_COLOR || process$2.env.CLICOLOR_FORCE !== void 0) return true;
23803
+ if (process$3.env.NO_COLOR || process$3.env.FORCE_COLOR === "0" || process$3.env.FORCE_COLOR === "false") return false;
23804
+ if (process$3.env.FORCE_COLOR || process$3.env.CLICOLOR_FORCE !== void 0) return true;
23804
23805
  }
23805
23806
  exports.Command = Command;
23806
23807
  exports.useColor = useColor;
@@ -31874,6 +31875,70 @@ _Mime_extensionToType = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtension = /
31874
31875
  //#region node_modules/.pnpm/mime@4.1.2/node_modules/mime/dist/src/index.js
31875
31876
  var src_default = new Mime(types$1, types$2)._freeze();
31876
31877
 
31878
+ //#endregion
31879
+ //#region ../../packages/utils/src/detectUtf16.ts
31880
+ var HEURISTIC_SAMPLE_BYTES, HEURISTIC_THRESHOLD, detectUtf16NoBom;
31881
+ var init_detectUtf16 = __esmMin((() => {
31882
+ HEURISTIC_SAMPLE_BYTES = 512;
31883
+ HEURISTIC_THRESHOLD = .3;
31884
+ detectUtf16NoBom = (buffer) => {
31885
+ const sample = buffer.subarray(0, Math.min(HEURISTIC_SAMPLE_BYTES, buffer.length));
31886
+ if (sample.length < 4 || sample.length % 2 !== 0) return null;
31887
+ let leAsciiPairs = 0;
31888
+ let beAsciiPairs = 0;
31889
+ const totalPairs = sample.length / 2;
31890
+ for (let i = 0; i < sample.length; i += 2) {
31891
+ const lo = sample[i];
31892
+ const hi = sample[i + 1];
31893
+ if (hi === 0 && lo !== 0) leAsciiPairs++;
31894
+ else if (lo === 0 && hi !== 0) beAsciiPairs++;
31895
+ }
31896
+ if (leAsciiPairs > beAsciiPairs && leAsciiPairs / totalPairs >= HEURISTIC_THRESHOLD) return "utf-16le";
31897
+ if (beAsciiPairs > leAsciiPairs && beAsciiPairs / totalPairs >= HEURISTIC_THRESHOLD) return "utf-16be";
31898
+ return null;
31899
+ };
31900
+ }));
31901
+
31902
+ //#endregion
31903
+ //#region ../../packages/utils/src/isBinaryContent.ts
31904
+ var NON_PRINTABLE_THRESHOLD, hasUtf8Bom, hasUtf16Bom, sniffBinaryBuffer, REPLACEMENT_CHAR, checkPrintableRatio;
31905
+ var init_isBinaryContent = __esmMin((() => {
31906
+ init_detectUtf16();
31907
+ NON_PRINTABLE_THRESHOLD = .3;
31908
+ hasUtf8Bom = (buf) => buf.length >= 3 && buf[0] === 239 && buf[1] === 187 && buf[2] === 191;
31909
+ hasUtf16Bom = (buf) => buf.length >= 2 && (buf[0] === 255 && buf[1] === 254 || buf[0] === 254 && buf[1] === 255);
31910
+ sniffBinaryBuffer = (buffer) => {
31911
+ if (buffer.length === 0) return { isBinary: false };
31912
+ if (hasUtf8Bom(buffer) || hasUtf16Bom(buffer)) return { isBinary: false };
31913
+ const utf16Variant = detectUtf16NoBom(buffer);
31914
+ if (utf16Variant) return checkPrintableRatio(new TextDecoder(utf16Variant, { fatal: false }).decode(buffer), buffer.length);
31915
+ if (buffer.includes(0)) return {
31916
+ isBinary: true,
31917
+ reason: "contains null byte"
31918
+ };
31919
+ return checkPrintableRatio(new TextDecoder("utf-8", { fatal: false }).decode(buffer), buffer.length);
31920
+ };
31921
+ REPLACEMENT_CHAR = "�";
31922
+ checkPrintableRatio = (text, sampledBytes) => {
31923
+ if (text.length === 0) return { isBinary: false };
31924
+ let suspect = 0;
31925
+ for (const ch of text) {
31926
+ if (ch === REPLACEMENT_CHAR) {
31927
+ suspect++;
31928
+ continue;
31929
+ }
31930
+ const code = ch.codePointAt(0);
31931
+ if (code < 32 && code !== 9 && code !== 10 && code !== 13) suspect++;
31932
+ }
31933
+ const ratio = suspect / text.length;
31934
+ if (ratio > NON_PRINTABLE_THRESHOLD) return {
31935
+ isBinary: true,
31936
+ reason: `${(ratio * 100).toFixed(1)}% non-printable chars in first ${sampledBytes} bytes`
31937
+ };
31938
+ return { isBinary: false };
31939
+ };
31940
+ }));
31941
+
31877
31942
  //#endregion
31878
31943
  //#region node_modules/.pnpm/strtok3@10.8.0/node_modules/strtok3/lib/stream/Errors.js
31879
31944
  var defaultMessages, EndOfStreamError, AbortError$1;
@@ -37233,6 +37298,7 @@ var init_file_type = __esmMin((() => {
37233
37298
 
37234
37299
  //#endregion
37235
37300
  //#region ../../packages/utils/src/mimeType.ts
37301
+ init_isBinaryContent();
37236
37302
  const CUSTOM_MIME_TYPES = {
37237
37303
  ".clj": "text/x-clojure",
37238
37304
  ".ex": "text/x-elixir",
@@ -37258,7 +37324,8 @@ const TEXT_FALLBACK_MIME = "text/plain; charset=utf-8";
37258
37324
  const BINARY_FALLBACK_MIME = "application/octet-stream";
37259
37325
  const TEXT_MIME_PATTERN = /^(?:text\/|application\/(?:ecmascript|graphql|javascript|json|toml|xhtml\+xml|xml|yaml))/;
37260
37326
  const SVG_MIME = "image/svg+xml";
37261
- const withCharset = (mimeType) => TEXT_MIME_PATTERN.test(mimeType) && !mimeType.includes("charset=") ? `${mimeType}; charset=utf-8` : mimeType;
37327
+ const DEFAULT_CHARSET = "utf-8";
37328
+ const withCharset = (mimeType, charset = DEFAULT_CHARSET) => TEXT_MIME_PATTERN.test(mimeType) && !mimeType.includes("charset=") ? `${mimeType}; charset=${charset}` : mimeType;
37262
37329
  const getExtension = (filePath) => {
37263
37330
  const fileName = filePath.replace(/^.*[/\\]/s, "");
37264
37331
  const dotIndex = fileName.lastIndexOf(".");
@@ -37273,6 +37340,32 @@ const looksBinary = (buffer) => {
37273
37340
  return false;
37274
37341
  };
37275
37342
  /**
37343
+ * Detect UTF-16 text marked by a byte order mark.
37344
+ *
37345
+ * The UTF-16LE BOM (0xFF 0xFE) is also a valid MPEG audio frame sync, so
37346
+ * file-type reports Windows PowerShell 5.1 output (`Tee-Object`, `Out-File`)
37347
+ * as audio/mpeg. The BOM alone is not proof: a real MPEG-1 Layer I frame can
37348
+ * start with the same bytes. Decode the bytes after the BOM strictly and
37349
+ * require them to read as text: compressed audio contains unpaired surrogates,
37350
+ * and a lenient decode would turn them into "printable" characters. `stream`
37351
+ * keeps a surrogate pair split by the sample boundary from failing the decode.
37352
+ */
37353
+ const detectUtf16BomText = (buffer) => {
37354
+ if (buffer.byteLength < 2) return null;
37355
+ let charset;
37356
+ if (buffer[0] === 255 && buffer[1] === 254) charset = "utf-16le";
37357
+ else if (buffer[0] === 254 && buffer[1] === 255) charset = "utf-16be";
37358
+ else return null;
37359
+ const sample = buffer.subarray(2, Math.min(buffer.byteLength, SNIFF_BYTES$1));
37360
+ let text;
37361
+ try {
37362
+ text = new TextDecoder(charset, { fatal: true }).decode(sample, { stream: true });
37363
+ } catch {
37364
+ return null;
37365
+ }
37366
+ return sniffBinaryBuffer(new TextEncoder().encode(text)).isBinary ? null : charset;
37367
+ };
37368
+ /**
37276
37369
  * Sync extension-only lookup. Falls back to `application/octet-stream` for
37277
37370
  * unknown extensions. Use this when a file buffer isn't available (URL input,
37278
37371
  * TRPC payload, filename-only records).
@@ -37288,6 +37381,9 @@ const getMimeType = (filePath) => {
37288
37381
  * Trust magic bytes first, then fall back to the extension, and let a text
37289
37382
  * sniff overrule mime-db when the two disagree.
37290
37383
  *
37384
+ * 0. UTF-16 BOM text → text mime with the matching charset, before the
37385
+ * magic-byte check (the UTF-16LE BOM looks like an MPEG audio frame).
37386
+ * Keeps a text extension mime, otherwise falls back to text/plain.
37291
37387
  * 1. `fileTypeFromBuffer()` — magic-byte detection. Authoritative when it
37292
37388
  * matches: real MPEG-TS media wins here regardless of extension. The one
37293
37389
  * exception is a generic `application/xml` match, which yields to the
@@ -37302,9 +37398,14 @@ const getMimeType = (filePath) => {
37302
37398
  * 3. No extension mapping → sniff-based fallback.
37303
37399
  */
37304
37400
  const resolveMimeType = async (filePath, buffer) => {
37401
+ const fromExtension = lookupExtensionMime(filePath);
37402
+ const utf16Charset = detectUtf16BomText(buffer);
37403
+ if (utf16Charset) {
37404
+ if (fromExtension === SVG_MIME) return SVG_MIME;
37405
+ return fromExtension && TEXT_MIME_PATTERN.test(fromExtension) ? withCharset(fromExtension, utf16Charset) : `text/plain; charset=${utf16Charset}`;
37406
+ }
37305
37407
  const { fileTypeFromBuffer } = await Promise.resolve().then(() => (init_file_type(), file_type_exports));
37306
37408
  const detected = await fileTypeFromBuffer(buffer);
37307
- const fromExtension = lookupExtensionMime(filePath);
37308
37409
  if (detected?.mime) {
37309
37410
  if (detected.mime === "application/xml" && fromExtension === SVG_MIME) return SVG_MIME;
37310
37411
  return detected.mime;
@@ -89705,70 +89806,6 @@ var init_fileParseBudget = __esmMin((() => {
89705
89806
  isFileParseBudgetError = (error) => error instanceof FileParseBudgetError || error instanceof Error && error.name === "FileParseBudgetError";
89706
89807
  }));
89707
89808
 
89708
- //#endregion
89709
- //#region ../../packages/utils/src/detectUtf16.ts
89710
- var HEURISTIC_SAMPLE_BYTES, HEURISTIC_THRESHOLD, detectUtf16NoBom;
89711
- var init_detectUtf16 = __esmMin((() => {
89712
- HEURISTIC_SAMPLE_BYTES = 512;
89713
- HEURISTIC_THRESHOLD = .3;
89714
- detectUtf16NoBom = (buffer) => {
89715
- const sample = buffer.subarray(0, Math.min(HEURISTIC_SAMPLE_BYTES, buffer.length));
89716
- if (sample.length < 4 || sample.length % 2 !== 0) return null;
89717
- let leAsciiPairs = 0;
89718
- let beAsciiPairs = 0;
89719
- const totalPairs = sample.length / 2;
89720
- for (let i = 0; i < sample.length; i += 2) {
89721
- const lo = sample[i];
89722
- const hi = sample[i + 1];
89723
- if (hi === 0 && lo !== 0) leAsciiPairs++;
89724
- else if (lo === 0 && hi !== 0) beAsciiPairs++;
89725
- }
89726
- if (leAsciiPairs > beAsciiPairs && leAsciiPairs / totalPairs >= HEURISTIC_THRESHOLD) return "utf-16le";
89727
- if (beAsciiPairs > leAsciiPairs && beAsciiPairs / totalPairs >= HEURISTIC_THRESHOLD) return "utf-16be";
89728
- return null;
89729
- };
89730
- }));
89731
-
89732
- //#endregion
89733
- //#region ../../packages/utils/src/isBinaryContent.ts
89734
- var NON_PRINTABLE_THRESHOLD, hasUtf8Bom, hasUtf16Bom, sniffBinaryBuffer, REPLACEMENT_CHAR, checkPrintableRatio;
89735
- var init_isBinaryContent = __esmMin((() => {
89736
- init_detectUtf16();
89737
- NON_PRINTABLE_THRESHOLD = .3;
89738
- hasUtf8Bom = (buf) => buf.length >= 3 && buf[0] === 239 && buf[1] === 187 && buf[2] === 191;
89739
- hasUtf16Bom = (buf) => buf.length >= 2 && (buf[0] === 255 && buf[1] === 254 || buf[0] === 254 && buf[1] === 255);
89740
- sniffBinaryBuffer = (buffer) => {
89741
- if (buffer.length === 0) return { isBinary: false };
89742
- if (hasUtf8Bom(buffer) || hasUtf16Bom(buffer)) return { isBinary: false };
89743
- const utf16Variant = detectUtf16NoBom(buffer);
89744
- if (utf16Variant) return checkPrintableRatio(new TextDecoder(utf16Variant, { fatal: false }).decode(buffer), buffer.length);
89745
- if (buffer.includes(0)) return {
89746
- isBinary: true,
89747
- reason: "contains null byte"
89748
- };
89749
- return checkPrintableRatio(new TextDecoder("utf-8", { fatal: false }).decode(buffer), buffer.length);
89750
- };
89751
- REPLACEMENT_CHAR = "�";
89752
- checkPrintableRatio = (text, sampledBytes) => {
89753
- if (text.length === 0) return { isBinary: false };
89754
- let suspect = 0;
89755
- for (const ch of text) {
89756
- if (ch === REPLACEMENT_CHAR) {
89757
- suspect++;
89758
- continue;
89759
- }
89760
- const code = ch.codePointAt(0);
89761
- if (code < 32 && code !== 9 && code !== 10 && code !== 13) suspect++;
89762
- }
89763
- const ratio = suspect / text.length;
89764
- if (ratio > NON_PRINTABLE_THRESHOLD) return {
89765
- isBinary: true,
89766
- reason: `${(ratio * 100).toFixed(1)}% non-printable chars in first ${sampledBytes} bytes`
89767
- };
89768
- return { isBinary: false };
89769
- };
89770
- }));
89771
-
89772
89809
  //#endregion
89773
89810
  //#region ../../packages/file-loaders/src/loaders/ipynb/index.ts
89774
89811
  var ipynb_exports = /* @__PURE__ */ __exportAll$2({
@@ -332348,7 +332385,7 @@ var stdio_exports = /* @__PURE__ */ __exportAll$2({
332348
332385
  function getDefaultEnvironment() {
332349
332386
  const env = {};
332350
332387
  for (const key of DEFAULT_INHERITED_ENV_VARS) {
332351
- const value = _w.env[key];
332388
+ const value = process$1.env[key];
332352
332389
  if (value === void 0) continue;
332353
332390
  if (value.startsWith("()")) continue;
332354
332391
  env[key] = value;
@@ -332359,7 +332396,7 @@ var import_cross_spawn$1, DEFAULT_INHERITED_ENV_VARS, StdioClientTransport;
332359
332396
  var init_stdio = __esmMin((() => {
332360
332397
  init_src_CeKsbNLO();
332361
332398
  import_cross_spawn$1 = /* @__PURE__ */ __toESM$2(require_cross_spawn(), 1);
332362
- DEFAULT_INHERITED_ENV_VARS = _w.platform === "win32" ? [
332399
+ DEFAULT_INHERITED_ENV_VARS = process$1.platform === "win32" ? [
332363
332400
  "APPDATA",
332364
332401
  "COMSPEC",
332365
332402
  "HOMEDRIVE",
@@ -332416,7 +332453,7 @@ var init_stdio = __esmMin((() => {
332416
332453
  this._serverParams.stderr ?? "inherit"
332417
332454
  ],
332418
332455
  shell: false,
332419
- windowsHide: _w.platform === "win32",
332456
+ windowsHide: process$1.platform === "win32",
332420
332457
  cwd: this._serverParams.cwd
332421
332458
  });
332422
332459
  this._process.on("error", (error) => {
@@ -335450,9 +335487,9 @@ const getSubprocessResult = ({ stdout }) => {
335450
335487
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/utils/standard-stream.js
335451
335488
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
335452
335489
  const STANDARD_STREAMS = [
335453
- _w.stdin,
335454
- _w.stdout,
335455
- _w.stderr
335490
+ process$1.stdin,
335491
+ process$1.stdout,
335492
+ process$1.stderr
335456
335493
  ];
335457
335494
  const STANDARD_STREAMS_ALIASES = [
335458
335495
  "stdin",
@@ -335577,9 +335614,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
335577
335614
  //#endregion
335578
335615
  //#region node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
335579
335616
  function isUnicodeSupported() {
335580
- const { env } = _w;
335617
+ const { env } = process$1;
335581
335618
  const { TERM, TERM_PROGRAM } = env;
335582
- if (_w.platform !== "win32") return TERM !== "linux";
335619
+ if (process$1.platform !== "win32") return TERM !== "linux";
335583
335620
  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";
335584
335621
  }
335585
335622
 
@@ -336114,7 +336151,7 @@ function traversePathUp(startPath) {
336114
336151
 
336115
336152
  //#endregion
336116
336153
  //#region node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
336117
- const npmRunPath = ({ cwd = _w.cwd(), path: pathOption = _w.env[pathKey()], preferLocal = true, execPath = _w.execPath, addExecPath = true } = {}) => {
336154
+ const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath = process$1.execPath, addExecPath = true } = {}) => {
336118
336155
  const cwdPath = path.resolve(toPath(cwd));
336119
336156
  const result = [];
336120
336157
  const pathParts = pathOption.split(path.delimiter);
@@ -336132,7 +336169,7 @@ const applyExecPath = (result, pathParts, execPath, cwdPath) => {
336132
336169
  const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
336133
336170
  if (!pathParts.includes(pathPart)) result.push(pathPart);
336134
336171
  };
336135
- const npmRunPathEnv = ({ env = _w.env, ...options } = {}) => {
336172
+ const npmRunPathEnv = ({ env = process$1.env, ...options } = {}) => {
336136
336173
  env = { ...env };
336137
336174
  const pathName = pathKey({ env });
336138
336175
  options.path = env[pathName];
@@ -337267,7 +337304,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
337267
337304
  };
337268
337305
  const getDefaultCwd = () => {
337269
337306
  try {
337270
- return _w.cwd();
337307
+ return process$1.cwd();
337271
337308
  } catch (error) {
337272
337309
  error.message = `The current directory does not exist.\n${error.message}`;
337273
337310
  throw error;
@@ -337303,7 +337340,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
337303
337340
  options.killSignal = normalizeKillSignal(options.killSignal);
337304
337341
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
337305
337342
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
337306
- if (_w.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
337343
+ if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
337307
337344
  return {
337308
337345
  file,
337309
337346
  commandArguments,
@@ -337330,7 +337367,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
337330
337367
  });
337331
337368
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
337332
337369
  const env = extendEnv ? {
337333
- ..._w.env,
337370
+ ...process$1.env,
337334
337371
  ...envOption
337335
337372
  } : envOption;
337336
337373
  if (preferLocal || node) return npmRunPathEnv({
@@ -338332,12 +338369,12 @@ const guessStreamDirection = {
338332
338369
  }
338333
338370
  };
338334
338371
  const getStandardStreamDirection = (value) => {
338335
- if ([0, _w.stdin].includes(value)) return "input";
338372
+ if ([0, process$1.stdin].includes(value)) return "input";
338336
338373
  if ([
338337
338374
  1,
338338
338375
  2,
338339
- _w.stdout,
338340
- _w.stderr
338376
+ process$1.stdout,
338377
+ process$1.stderr
338341
338378
  ].includes(value)) return "output";
338342
338379
  };
338343
338380
  const DEFAULT_DIRECTION = "output";
@@ -339401,9 +339438,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
339401
339438
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
339402
339439
  };
339403
339440
  const getIpcExport = () => {
339404
- const anyProcess = _w;
339441
+ const anyProcess = process$1;
339405
339442
  const isSubprocess = true;
339406
- const ipc = _w.channel !== void 0;
339443
+ const ipc = process$1.channel !== void 0;
339407
339444
  return {
339408
339445
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
339409
339446
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -339880,7 +339917,7 @@ var SignalExitFallback = class extends SignalExitBase {
339880
339917
  };
339881
339918
  var SignalExit = class extends SignalExitBase {
339882
339919
  /* c8 ignore start */
339883
- #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
339920
+ #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
339884
339921
  /* c8 ignore stop */
339885
339922
  #emitter = new Emitter();
339886
339923
  #process;
@@ -339975,8 +340012,8 @@ var SignalExit = class extends SignalExitBase {
339975
340012
  } else return og.call(this.#process, ev, ...args);
339976
340013
  }
339977
340014
  };
339978
- const process$1 = globalThis.process;
339979
- const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
340015
+ const process$2 = globalThis.process;
340016
+ const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
339980
340017
 
339981
340018
  //#endregion
339982
340019
  //#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 "" "@lichao0223/lobehub\-cli 0.0.78" "User Commands"
3
+ .TH LH 1 "" "@lichao0223/lobehub\-cli 0.0.80" "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": "@lichao0223/lobehub-cli",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/lichao0223/lobehub",
@@ -83,5 +83,5 @@
83
83
  "access": "public",
84
84
  "registry": "https://registry.npmjs.org"
85
85
  },
86
- "gitHead": "a819fd24b0cb03dc8f7a1dd5b7948ea10c6ed5b8"
86
+ "gitHead": "8bccb477727f96c43528f3649ead68d747c3d99b"
87
87
  }