@pixelzx/genesis 2026.5.1-beta.4 → 2026.5.2-beta.1

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 (52) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-startup-metadata.json +1 -1
  5. package/dist/{command-registry-Df1lKsUc.js → command-registry-CELOML3x.js} +2 -2
  6. package/dist/{command-registry-BPCQsvFl.js → command-registry-CaTzNL-_.js} +2 -2
  7. package/dist/{command-registry-core-BMfGHWDR.js → command-registry-core-CW5mTJBJ.js} +3 -3
  8. package/dist/{completion-cli-xy6TliKu.js → completion-cli-Dh6jfk_T.js} +2 -2
  9. package/dist/{config-cli-BAti5HW3.js → config-cli-BevRE0_m.js} +1 -1
  10. package/dist/{doctor-health-BpIpqLVE.js → doctor-health-DS0tystX.js} +1 -1
  11. package/dist/{doctor-update-BF4xntlm.js → doctor-update-BTCy8Euz.js} +1 -1
  12. package/dist/entry.js +1 -1
  13. package/dist/extensions/qqbot/api.js +8 -7
  14. package/dist/extensions/qqbot/{bootstrap-CNNmgx9g.js → bootstrap-FVplSsCK.js} +1 -1
  15. package/dist/extensions/qqbot/{channel-CCdEtls5.js → channel-DMxH0bbv.js} +11 -11
  16. package/dist/extensions/qqbot/channel-plugin-api.js +1 -1
  17. package/dist/extensions/qqbot/{channel.setup-B37sECi3.js → channel.setup-CF-9jlzM.js} +2 -2
  18. package/dist/extensions/qqbot/{config-COehCmMt.js → config-CURNx2-h.js} +1 -2
  19. package/dist/extensions/qqbot/{config-schema-CluJ8Y_G.js → config-schema-DmBxoVwV.js} +2 -2
  20. package/dist/extensions/qqbot/{exec-approvals-BCPh7ydn.js → exec-approvals-72KCMpsJ.js} +1 -1
  21. package/dist/extensions/qqbot/{gateway-CGBWORwP.js → gateway-CPsYlL6U.js} +11 -11
  22. package/dist/extensions/qqbot/{handler-runtime-C-yJD6su.js → handler-runtime-DzIIlsHO.js} +4 -4
  23. package/dist/extensions/qqbot/log-B7WOcv0o.js +79 -0
  24. package/dist/extensions/qqbot/{outbound-BHI0KZV_.js → outbound-x8tWBZvi.js} +5 -5
  25. package/dist/extensions/qqbot/{request-context-BphpGmQk.js → request-context-BxHw_0qm.js} +2 -2
  26. package/dist/extensions/qqbot/{runtime-BMHSX5zj.js → runtime-CwcVyk-D.js} +0 -3
  27. package/dist/extensions/qqbot/runtime-api.js +1 -1
  28. package/dist/extensions/qqbot/{sender-UWA8B8IF.js → sender-C1cNu_mI.js} +3 -84
  29. package/dist/extensions/qqbot/setup-plugin-api.js +1 -1
  30. package/dist/extensions/qqbot/{string-normalize-DpiT0I4g.js → string-normalize-BA3kIlSd.js} +35 -1
  31. package/dist/extensions/qqbot/{target-parser-D-NotuzW.js → target-parser-DWaW87yJ.js} +3 -3
  32. package/dist/{gateway-cli-CuCzvq5m.js → gateway-cli-DdKbpAgA.js} +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
  35. package/dist/postinstall-inventory.json +38 -38
  36. package/dist/{program-C2PQk8M2.js → program-D4VsajvL.js} +1 -1
  37. package/dist/{prompt-select-styled-B4a6E09s.js → prompt-select-styled-B1NyT9lL.js} +1 -1
  38. package/dist/{register.maintenance-BTBMmP08.js → register.maintenance-CfVFrbm8.js} +1 -1
  39. package/dist/{register.subclis-CLp1LBcX.js → register.subclis-DUsJuHOf.js} +2 -2
  40. package/dist/{register.subclis-core-B_l2Hgvz.js → register.subclis-core-D6mZM5Ky.js} +2 -2
  41. package/dist/{register.subclis-DfvN7Gr2.js → register.subclis-fyWrDApy.js} +1 -1
  42. package/dist/{run-main-DmxHkvgN.js → run-main-D6OomqlZ.js} +4 -4
  43. package/dist/{runtime-schema-CH6RQtCU.js → runtime-schema-D6aI8bq5.js} +1 -1
  44. package/dist/{server-BZFXQ4aN.js → server-CHDEIl13.js} +1 -1
  45. package/dist/{server-plugin-bootstrap-88fvnXg-.js → server-plugin-bootstrap-BVXCvRdw.js} +1 -1
  46. package/dist/{server-plugin-bootstrap-BrLbaEJb.js → server-plugin-bootstrap-Cj9hGs3S.js} +2 -2
  47. package/dist/{server.impl-gONje-YS.js → server.impl-Cdf3zdIx.js} +2 -2
  48. package/dist/{update-cli-FCImXBZs.js → update-cli-DPG_N1YV.js} +7 -5
  49. package/dist/{update-runner-C62Lm0-d.js → update-runner-DRsGtv9-.js} +59 -11
  50. package/package.json +1 -1
  51. package/dist/extensions/qqbot/adapter-DfD2SNGz.js +0 -35
  52. /package/dist/extensions/qqbot/{text-chunk-jl3-82oM.js → text-chunk-DMqFPfIP.js} +0 -0
@@ -210,8 +210,8 @@ async function readPackageDistInventoryIfPresent(packageRoot) {
210
210
  }
211
211
  //#endregion
212
212
  //#region src/infra/update-global.ts
213
- const PRIMARY_PACKAGE_NAME = "genesis";
214
- const ALL_PACKAGE_NAMES = [PRIMARY_PACKAGE_NAME];
213
+ const PRIMARY_PACKAGE_NAME = "@pixelzx/genesis";
214
+ const ALL_PACKAGE_NAMES = [PRIMARY_PACKAGE_NAME, "genesis"];
215
215
  const GLOBAL_RENAME_PREFIX = ".";
216
216
  const GENESIS_MAIN_PACKAGE_SPEC = "github:PIXELZX0/Genesis#main";
217
217
  const COREPACK_ENABLE_DOWNLOAD_PROMPT_DEFAULT = "0";
@@ -393,6 +393,25 @@ async function tryRealpath(targetPath) {
393
393
  return path.resolve(targetPath);
394
394
  }
395
395
  }
396
+ function packageNameToPathSegments(packageName) {
397
+ return packageName.split("/").filter((segment) => segment.length > 0);
398
+ }
399
+ function resolvePackageInstallRoot(globalRoot, packageName) {
400
+ return path.join(globalRoot, ...packageNameToPathSegments(packageName));
401
+ }
402
+ async function resolveGlobalPackageRootForInstall(params) {
403
+ const pkgRoot = params.pkgRoot?.trim();
404
+ if (pkgRoot) {
405
+ const pkgReal = path.resolve(await tryRealpath(pkgRoot));
406
+ const globalReal = await tryRealpath(params.globalRoot);
407
+ for (const name of ALL_PACKAGE_NAMES) if (path.resolve(await tryRealpath(resolvePackageInstallRoot(globalReal, name))) === pkgReal) return pkgRoot;
408
+ }
409
+ for (const name of ALL_PACKAGE_NAMES) {
410
+ const candidate = resolvePackageInstallRoot(params.globalRoot, name);
411
+ if (await pathExists(candidate)) return candidate;
412
+ }
413
+ return resolvePackageInstallRoot(params.globalRoot, PRIMARY_PACKAGE_NAME);
414
+ }
396
415
  function resolveBunGlobalRoot() {
397
416
  const bunInstall = process.env.BUN_INSTALL?.trim() || path.join(os.homedir(), ".bun");
398
417
  return path.join(bunInstall, "install", "global", "node_modules");
@@ -401,7 +420,8 @@ function inferNpmPrefixFromPackageRoot(pkgRoot) {
401
420
  const trimmed = pkgRoot?.trim();
402
421
  if (!trimmed) return null;
403
422
  const normalized = path.resolve(trimmed);
404
- const nodeModulesDir = path.dirname(normalized);
423
+ const packageParent = path.dirname(normalized);
424
+ const nodeModulesDir = path.basename(packageParent) === "node_modules" ? packageParent : path.dirname(packageParent);
405
425
  if (path.basename(nodeModulesDir) !== "node_modules") return null;
406
426
  const parentDir = path.dirname(nodeModulesDir);
407
427
  if (path.basename(parentDir) === "lib") return path.dirname(parentDir);
@@ -444,7 +464,10 @@ async function resolveGlobalInstallTarget(params) {
444
464
  return {
445
465
  ...command,
446
466
  globalRoot,
447
- packageRoot: globalRoot ? path.join(globalRoot, PRIMARY_PACKAGE_NAME) : null
467
+ packageRoot: globalRoot ? await resolveGlobalPackageRootForInstall({
468
+ globalRoot,
469
+ pkgRoot: params.pkgRoot
470
+ }) : null
448
471
  };
449
472
  }
450
473
  async function detectGlobalInstallManagerForRoot(runCommand, pkgRoot, timeoutMs) {
@@ -470,13 +493,13 @@ async function detectGlobalInstallManagerForRoot(runCommand, pkgRoot, timeoutMs)
470
493
  if (!globalRoot) continue;
471
494
  const globalReal = await tryRealpath(globalRoot);
472
495
  for (const name of ALL_PACKAGE_NAMES) {
473
- const expectedReal = await tryRealpath(path.join(globalReal, name));
496
+ const expectedReal = await tryRealpath(resolvePackageInstallRoot(globalReal, name));
474
497
  if (path.resolve(expectedReal) === path.resolve(pkgReal)) return manager;
475
498
  }
476
499
  }
477
500
  const bunGlobalReal = await tryRealpath(resolveBunGlobalRoot());
478
501
  for (const name of ALL_PACKAGE_NAMES) {
479
- const bunExpectedReal = await tryRealpath(path.join(bunGlobalReal, name));
502
+ const bunExpectedReal = await tryRealpath(resolvePackageInstallRoot(bunGlobalReal, name));
480
503
  if (path.resolve(bunExpectedReal) === path.resolve(pkgReal)) return "bun";
481
504
  }
482
505
  if (resolvePreferredNpmCommand(pkgRoot)) return "npm";
@@ -486,10 +509,10 @@ async function detectGlobalInstallManagerByPresence(runCommand, timeoutMs) {
486
509
  for (const manager of ["npm", "pnpm"]) {
487
510
  const root = await resolveGlobalRoot(manager, runCommand, timeoutMs);
488
511
  if (!root) continue;
489
- for (const name of ALL_PACKAGE_NAMES) if (await pathExists(path.join(root, name))) return manager;
512
+ for (const name of ALL_PACKAGE_NAMES) if (await pathExists(resolvePackageInstallRoot(root, name))) return manager;
490
513
  }
491
514
  const bunRoot = resolveBunGlobalRoot();
492
- for (const name of ALL_PACKAGE_NAMES) if (await pathExists(path.join(bunRoot, name))) return "bun";
515
+ for (const name of ALL_PACKAGE_NAMES) if (await pathExists(resolvePackageInstallRoot(bunRoot, name))) return "bun";
493
516
  return null;
494
517
  }
495
518
  function globalInstallArgs(managerOrCommand, spec, pkgRoot) {
@@ -530,7 +553,7 @@ async function cleanupGlobalRenameDirs(params) {
530
553
  const root = params.globalRoot.trim();
531
554
  const name = params.packageName.trim();
532
555
  if (!root || !name) return { removed };
533
- const prefix = `${GLOBAL_RENAME_PREFIX}${name}-`;
556
+ const prefix = `${GLOBAL_RENAME_PREFIX}${packageNameToPathSegments(name).at(-1) ?? name}-`;
534
557
  let entries = [];
535
558
  try {
536
559
  entries = await fs$1.readdir(root);
@@ -789,7 +812,7 @@ const START_DIRS = [
789
812
  "process"
790
813
  ];
791
814
  const DEFAULT_PACKAGE_NAME = "genesis";
792
- const CORE_PACKAGE_NAMES = new Set([DEFAULT_PACKAGE_NAME]);
815
+ const CORE_PACKAGE_NAMES = new Set([DEFAULT_PACKAGE_NAME, "@pixelzx/genesis"]);
793
816
  const PREFLIGHT_TEMP_PREFIX = process.platform === "win32" ? "ocu-pf-" : "genesis-update-preflight-";
794
817
  const PREFLIGHT_WORKTREE_DIRNAME = process.platform === "win32" ? "wt" : "worktree";
795
818
  const WINDOWS_PREFLIGHT_BASE_DIR = "ocu";
@@ -810,6 +833,24 @@ function resolveNodeModulesBinPackageRoot(argv1) {
810
833
  const nodeModulesDir = parts.slice(0, binIndex).join(path.sep);
811
834
  return path.join(nodeModulesDir, binName);
812
835
  }
836
+ function resolveNodeModulesPackageRootFromPath(targetPath) {
837
+ const parts = path.resolve(targetPath).split(path.sep);
838
+ const nodeModulesIndex = parts.lastIndexOf("node_modules");
839
+ if (nodeModulesIndex < 0) return null;
840
+ const packageStart = nodeModulesIndex + 1;
841
+ const packageHead = parts[packageStart];
842
+ if (!packageHead || packageHead === ".bin") return null;
843
+ const packageEnd = packageHead.startsWith("@") ? packageStart + 2 : packageStart + 1;
844
+ if (parts.length < packageEnd || !parts[packageEnd - 1]) return null;
845
+ return parts.slice(0, packageEnd).join(path.sep) || path.sep;
846
+ }
847
+ function tryRealpathSync(targetPath) {
848
+ try {
849
+ return fs.realpathSync(targetPath);
850
+ } catch {
851
+ return null;
852
+ }
853
+ }
813
854
  function buildStartDirs(opts) {
814
855
  const dirs = [];
815
856
  const cwd = normalizeDir(opts.cwd);
@@ -817,6 +858,12 @@ function buildStartDirs(opts) {
817
858
  const argv1 = normalizeDir(opts.argv1);
818
859
  if (argv1) {
819
860
  dirs.push(path.dirname(argv1));
861
+ const argv1Realpath = tryRealpathSync(argv1);
862
+ if (argv1Realpath && path.resolve(argv1Realpath) !== argv1) {
863
+ dirs.push(path.dirname(argv1Realpath));
864
+ const realPackageRoot = resolveNodeModulesPackageRootFromPath(argv1Realpath);
865
+ if (realPackageRoot) dirs.push(realPackageRoot);
866
+ }
820
867
  const packageRoot = resolveNodeModulesBinPackageRoot(argv1);
821
868
  if (packageRoot) dirs.push(packageRoot);
822
869
  }
@@ -1803,7 +1850,8 @@ async function runGatewayUpdate(opts = {}) {
1803
1850
  const verifiedPackageRoot = (await resolveGlobalInstallTarget({
1804
1851
  manager: installTarget,
1805
1852
  runCommand,
1806
- timeoutMs
1853
+ timeoutMs,
1854
+ pkgRoot
1807
1855
  })).packageRoot ?? pkgRoot;
1808
1856
  const verificationErrors = await collectInstalledGlobalPackageErrors({
1809
1857
  packageRoot: verifiedPackageRoot,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelzx/genesis",
3
- "version": "2026.5.1-beta.4",
3
+ "version": "2026.5.2-beta.1",
4
4
  "description": "Multi-channel AI gateway with extensible messaging integrations",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/PIXELZX0/Genesis#readme",
@@ -1,35 +0,0 @@
1
- //#region extensions/qqbot/src/engine/adapter/index.ts
2
- let _adapter = null;
3
- let _adapterFactory = null;
4
- /** Register the platform adapter. Called once during startup. */
5
- function registerPlatformAdapter(adapter) {
6
- _adapter = adapter;
7
- }
8
- /**
9
- * Register a factory that creates the PlatformAdapter on first access.
10
- *
11
- * This decouples adapter availability from side-effect import ordering.
12
- * The factory is invoked at most once — on the first `getPlatformAdapter()`
13
- * call when no adapter has been explicitly registered yet.
14
- */
15
- function registerPlatformAdapterFactory(factory) {
16
- _adapterFactory = factory;
17
- }
18
- /**
19
- * Get the registered platform adapter.
20
- *
21
- * If no adapter has been explicitly registered yet but a factory was provided
22
- * via `registerPlatformAdapterFactory()`, the factory is invoked to create
23
- * and register the adapter automatically.
24
- */
25
- function getPlatformAdapter() {
26
- if (!_adapter && _adapterFactory) _adapter = _adapterFactory();
27
- if (!_adapter) throw new Error("PlatformAdapter not registered. Call registerPlatformAdapter() during bootstrap.");
28
- return _adapter;
29
- }
30
- /** Check whether a platform adapter has been registered (or can be created from a factory). */
31
- function hasPlatformAdapter() {
32
- return _adapter !== null || _adapterFactory !== null;
33
- }
34
- //#endregion
35
- export { registerPlatformAdapterFactory as i, hasPlatformAdapter as n, registerPlatformAdapter as r, getPlatformAdapter as t };