@luckylillia-dev/luckylillia 9.0.7 → 9.0.9

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/llbot-core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as isManaged, $t as globalVars_exports, A as removeScannedPackage, At as normalizePlatformId, B as parseSpec, C as parsePluginDependencies, Ct as upgradeConfig, D as sdkIncompatibility, Dt as acceptsScope, E as scanPluginRoots, Et as normalizeUi, F as Registry, Ft as require_dist, G as installHostLifecycle, Gt as getPluginDirs, H as lockInstance, I as RegistryError, It as configPaths, Jt as isPluginHmr, Kt as isDevMode, L as isExactVersion, Lt as configPaths_exports, M as require_semver, Mt as deepMerge, N as IntegrityError, Nt as mergeNewProperties, O as sdkRangeOf, Ot as normalizeScope, P as Registries, Pt as JsonFile, Qt as TEMP_DIR, R as isPackageName, Rt as currentInstance, S as normalizeService, St as templateSection, T as resolveMain, Tt as newEntryId, V as pickVersion, Wt as environment_exports, X as GATEWAY_SECRET_HEADER, Xt as LOG_DIR, Y as GATEWAY_SECRET_ENV, Yt as DATA_DIR, _ as SDK_PACKAGE, _t as withCurrentNames, at as HtmlEscapedCallbackPhase, b as manifest_exports, bt as DEPRECATED_KEYS, c as marketSettings, ct as migrateExtractedPlugins, d as DEFAULT_GITHUB_MIRRORS, dt as migrateToInstances, en as __commonJSMin, et as isManagerMessage, f as githubAssetUrl, ft as migrateWebuiToken, g as PLUGIN_CATEGORIES, gt as renamed_exports, h as readTarStream, ht as currentPackageName, it as Hono, j as scannedPackagePath, jt as platform_exports, k as cleanupRemovedPackages, kt as normalizePlatform, l as registriesOf, lt as migrateNTQQMessaging, m as extractPackage, mt as RENAMED_PACKAGES, nn as __require, nt as version$10, ot as resolveCallback, p as isGitHubMirror, pt as renameNativeQQSettings, qt as isDockerEnvironment, r as coreUpdate_exports, rn as __toESM, rt as version_exports, s as MarketSchema, st as liftBuiltinSettings, tn as __exportAll, tt as protocol_exports, u as Catalog, ut as migrateRenamedPackages, v as isImagePath, vt as ADAPTER_ENTRIES, w as readPluginPackage, wt as PluginStore, x as matchesPluginVersion, xt as templateConfig, y as isInside, yt as ADAPTER_KEYS, z as matches, zt as instance_exports } from "./chunks/coreUpdate-Bhae6JrK.js";
1
+ import { $ as isManaged, $t as globalVars_exports, A as removeScannedPackage, At as normalizePlatformId, B as parseSpec, C as parsePluginDependencies, Ct as upgradeConfig, D as sdkIncompatibility, Dt as acceptsScope, E as scanPluginRoots, Et as normalizeUi, F as Registry, Ft as require_dist, G as installHostLifecycle, Gt as getPluginDirs, H as lockInstance, I as RegistryError, It as configPaths, Jt as isPluginHmr, Kt as isDevMode, L as isExactVersion, Lt as configPaths_exports, M as require_semver, Mt as deepMerge, N as IntegrityError, Nt as mergeNewProperties, O as sdkRangeOf, Ot as normalizeScope, P as Registries, Pt as JsonFile, Qt as TEMP_DIR, R as isPackageName, Rt as currentInstance, S as normalizeService, St as templateSection, T as resolveMain, Tt as newEntryId, V as pickVersion, Wt as environment_exports, X as GATEWAY_SECRET_HEADER, Xt as LOG_DIR, Y as GATEWAY_SECRET_ENV, Yt as DATA_DIR, _ as SDK_PACKAGE, _t as withCurrentNames, at as HtmlEscapedCallbackPhase, b as manifest_exports, bt as DEPRECATED_KEYS, c as marketSettings, ct as migrateExtractedPlugins, d as DEFAULT_GITHUB_MIRRORS, dt as migrateToInstances, en as __commonJSMin, et as isManagerMessage, f as githubAssetUrl, ft as migrateWebuiToken, g as PLUGIN_CATEGORIES, gt as renamed_exports, h as readTarStream, ht as currentPackageName, it as Hono, j as scannedPackagePath, jt as platform_exports, k as cleanupRemovedPackages, kt as normalizePlatform, l as registriesOf, lt as migrateNTQQMessaging, m as extractPackage, mt as RENAMED_PACKAGES, nn as __require, nt as version$10, ot as resolveCallback, p as isGitHubMirror, pt as renameNativeQQSettings, qt as isDockerEnvironment, r as coreUpdate_exports, rn as __toESM, rt as version_exports, s as MarketSchema, st as liftBuiltinSettings, tn as __exportAll, tt as protocol_exports, u as Catalog, ut as migrateRenamedPackages, v as isImagePath, vt as ADAPTER_ENTRIES, w as readPluginPackage, wt as PluginStore, x as matchesPluginVersion, xt as templateConfig, y as isInside, yt as ADAPTER_KEYS, z as matches, zt as instance_exports } from "./chunks/coreUpdate-33NXrGUa.js";
2
2
  import { p as compareVersions } from "./chunks/restart-TVy8kurW.js";
3
3
  import { t as __vitePreload } from "./chunks/preload-helper-DxWiKyOd.js";
4
4
  import * as nodeModule from "node:module";
@@ -6725,7 +6725,6 @@ var canFallbackToGitHub = (error) => error instanceof RegistryError && !(error i
6725
6725
  /** Resolve the actual archive before dependency planning, even when npm metadata exists but its file is unavailable. */
6726
6726
  var GitHubPackages = class {
6727
6727
  pending = /* @__PURE__ */ new Map();
6728
- manifests = /* @__PURE__ */ new Map();
6729
6728
  cache;
6730
6729
  downloader;
6731
6730
  mirrors;
@@ -6747,7 +6746,7 @@ var GitHubPackages = class {
6747
6746
  }
6748
6747
  });
6749
6748
  }
6750
- resolve(entry, registry, npm, metadataOnly = false) {
6749
+ resolve(entry, registry, npm) {
6751
6750
  const key = JSON.stringify([
6752
6751
  entry.name,
6753
6752
  entry.version,
@@ -6755,16 +6754,10 @@ var GitHubPackages = class {
6755
6754
  entry.github,
6756
6755
  npm?.dist
6757
6756
  ]);
6758
- const manifest = this.manifests.get(key);
6759
- if (metadataOnly && manifest) return Promise.resolve({ manifest });
6760
6757
  if (this.cache?.key === key && this.cache.expires > Date.now()) return Promise.resolve(this.cache.source);
6761
6758
  const pending = this.pending.get(key);
6762
6759
  if (pending) return pending;
6763
6760
  const result = this.read(entry, registry, npm).then((source) => {
6764
- if (source.directory === void 0) {
6765
- if (this.manifests.size >= 64) this.manifests.delete(this.manifests.keys().next().value);
6766
- this.manifests.set(key, source.manifest);
6767
- }
6768
6761
  if (source.directory === void 0 && source.tarball && source.tarball.length <= 33554432) this.cache = {
6769
6762
  key,
6770
6763
  expires: Date.now() + 6e4,
@@ -6857,6 +6850,8 @@ var MarketError = class extends Error {
6857
6850
  this.status = status;
6858
6851
  }
6859
6852
  };
6853
+ /** An update hint must not download a GitHub archive just to inspect its dependency manifest. */
6854
+ var DeferredGitHubUpdateCheck = class extends Error {};
6860
6855
  var PAGE_SIZE = 20;
6861
6856
  /** Use the same declared title and locale preference as the plugin card. */
6862
6857
  function entryTitle(entry) {
@@ -6988,9 +6983,12 @@ var Market = class {
6988
6983
  return;
6989
6984
  }
6990
6985
  info.latest = entry.version;
6991
- if (entry.github && !newer(entry.version, pkg.version)) return;
6986
+ if (entry.github) {
6987
+ if (newer(entry.version, pkg.version)) info.update = entry.version;
6988
+ return;
6989
+ }
6992
6990
  const document = packument(pkg.name);
6993
- const source = await this.catalogSource(entry, document, true);
6991
+ const source = await this.catalogSource(entry, document);
6994
6992
  const deprecated = await document.then((value) => value.versions[pkg.version]?.deprecated, () => void 0);
6995
6993
  if (deprecated) info.deprecated = deprecated;
6996
6994
  const approved = source.manifest;
@@ -7004,7 +7002,8 @@ var Market = class {
7004
7002
  }
7005
7003
  }
7006
7004
  } catch (e) {
7007
- if (e instanceof MarketError || e instanceof RegistryError && e.status === 404) info.blocked = e.message;
7005
+ if (e instanceof DeferredGitHubUpdateCheck && info.latest && newer(info.latest, pkg.version)) info.update = info.latest;
7006
+ else if (e instanceof MarketError || e instanceof RegistryError && e.status === 404) info.blocked = e.message;
7008
7007
  else info.error = e.message;
7009
7008
  }
7010
7009
  }));
@@ -7174,7 +7173,7 @@ var Market = class {
7174
7173
  if (!entry) throw new MarketError(`${name} is not found in the plugin market list; it cannot be installed`, 404);
7175
7174
  return entry;
7176
7175
  }
7177
- async catalogSource(entry, initial, metadataOnly = false) {
7176
+ async catalogSource(entry, initial) {
7178
7177
  const pinned = (document) => Object.hasOwn(document.versions ?? {}, entry.version);
7179
7178
  let document;
7180
7179
  try {
@@ -7182,15 +7181,15 @@ var Market = class {
7182
7181
  if (!document || !pinned(document)) document = await this.registry.packument(entry.name, true, pinned, "install");
7183
7182
  } catch (error) {
7184
7183
  if (!entry.github || !canFallbackToGitHub(error)) throw error;
7185
- return this.github.resolve(entry, this.registry, void 0, metadataOnly);
7184
+ return this.github.resolve(entry, this.registry);
7186
7185
  }
7187
7186
  const version = pinned(document) ? document.versions[entry.version] : void 0;
7188
7187
  if (!version) {
7189
- if (entry.github) return this.github.resolve(entry, this.registry, void 0, metadataOnly);
7188
+ if (entry.github) return this.github.resolve(entry, this.registry);
7190
7189
  throw new MarketError(`${entry.name}: catalog version ${entry.version} is unavailable from the npm registry`, 404);
7191
7190
  }
7192
7191
  if (document.name !== entry.name || version.name !== entry.name || version.version !== entry.version) throw new MarketError(`the registry returned a different package or version for ${entry.name}@${entry.version}`);
7193
- return entry.github ? this.github.resolve(entry, this.registry, version, metadataOnly) : { manifest: version };
7192
+ return entry.github ? this.github.resolve(entry, this.registry, version) : { manifest: version };
7194
7193
  }
7195
7194
  planned(source, name) {
7196
7195
  const version = source.manifest;
@@ -7208,7 +7207,7 @@ var Market = class {
7208
7207
  }
7209
7208
  }
7210
7209
  /** Resolve the complete plugin graph before writing anything. npm library dependencies stay with Installer. */
7211
- async planPlugins(main, catalog, packument = (name) => this.registry.packument(name, true, void 0, "install"), requestedVersion, metadataOnly = false) {
7210
+ async planPlugins(main, catalog, packument = (name) => this.registry.packument(name, true, void 0, "install"), requestedVersion, checkingUpdates = false) {
7212
7211
  const installed = new Map(this.installedPackages().map((pkg) => [pkg.name, pkg]));
7213
7212
  const installedRequirements = /* @__PURE__ */ new Map();
7214
7213
  for (const pkg of installed.values()) {
@@ -7269,7 +7268,8 @@ var Market = class {
7269
7268
  conflict = `${parent} needs ${name}@${ranges.join(" and ")}, but the market catalog only lists ${entry.version}`;
7270
7269
  return;
7271
7270
  }
7272
- const source = await this.catalogSource(entry, packument(name), metadataOnly);
7271
+ if (checkingUpdates && entry.github) throw new DeferredGitHubUpdateCheck();
7272
+ const source = await this.catalogSource(entry, packument(name));
7273
7273
  const candidate = source.manifest;
7274
7274
  const problem = this.incompatibility(candidate);
7275
7275
  if (problem) {