@h-ai/cli 1.0.0-beta.21 → 1.0.0-beta.23

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 (60) hide show
  1. package/README.en.md +13 -12
  2. package/README.ja.md +13 -12
  3. package/README.md +13 -12
  4. package/dist/{chunk-2ZL5ORQ2.js → chunk-P2VZ3VV6.js} +2 -14
  5. package/dist/chunk-P2VZ3VV6.js.map +1 -0
  6. package/dist/{chunk-L53P43B2.js → chunk-V7WGSBX3.js} +41 -21
  7. package/dist/chunk-V7WGSBX3.js.map +1 -0
  8. package/dist/cli-config-templates-VLXJTHCQ.js +5 -0
  9. package/dist/{cli-config-templates-LWMD2I6V.js.map → cli-config-templates-VLXJTHCQ.js.map} +1 -1
  10. package/dist/{cli-skill-templates-D6S2OQ6X.js → cli-skill-templates-JKF6E3PI.js} +3 -3
  11. package/dist/{cli-skill-templates-D6S2OQ6X.js.map → cli-skill-templates-JKF6E3PI.js.map} +1 -1
  12. package/dist/index.js +161 -244
  13. package/dist/index.js.map +1 -1
  14. package/dist/metafile-esm.json +1 -1
  15. package/package.json +14 -14
  16. package/templates/apps/fullstack/docs/security-configuration.md.hbs +3 -3
  17. package/templates/apps/fullstack/images/web/nginx.conf.hbs +3 -1
  18. package/templates/apps/fullstack/packages/{{projectName}}-serv/README.md.hbs +1 -1
  19. package/templates/apps/fullstack/packages/{{projectName}}-shared/tests/api-client.test.ts.hbs +4 -1
  20. package/templates/base/images/web/nginx.conf.hbs +3 -1
  21. package/templates/base/package.json.hbs +1 -1
  22. package/templates/shared/download-error/http.conf +19 -0
  23. package/templates/shared/download-error/server.conf +52 -0
  24. package/templates/skills/hai-ai/acp.md +1 -1
  25. package/templates/skills/hai-ai/guide.md +1 -1
  26. package/templates/skills/hai-ai/reference.md +1 -1
  27. package/templates/skills/hai-api-client/SKILL.md +2 -2
  28. package/templates/skills/hai-app-create/SKILL.md +2 -0
  29. package/templates/skills/hai-app-create/development.md +3 -3
  30. package/templates/skills/hai-app-create/logging.md +32 -0
  31. package/templates/skills/hai-app-create/project.md +1 -0
  32. package/templates/skills/hai-app-create/reference.md +2 -4
  33. package/templates/skills/hai-app-review/SKILL.md +1 -1
  34. package/templates/skills/hai-audit/SKILL.md +1 -1
  35. package/templates/skills/hai-audit/reference.md +1 -1
  36. package/templates/skills/hai-build/SKILL.md +1 -1
  37. package/templates/skills/hai-build/paths.md +1 -1
  38. package/templates/skills/hai-core/reference.md +2 -11
  39. package/templates/skills/hai-crypto/SKILL.md +1 -1
  40. package/templates/skills/hai-crypto/reference.md +3 -3
  41. package/templates/skills/hai-deploy/SKILL.md +8 -8
  42. package/templates/skills/hai-deploy/middleware.md +2 -2
  43. package/templates/skills/hai-framework-sync/SKILL.md +4 -4
  44. package/templates/skills/hai-iam/SKILL.md +1 -1
  45. package/templates/skills/hai-iam/reference.md +1 -1
  46. package/templates/skills/hai-kit/SKILL.md +2 -2
  47. package/templates/skills/hai-kit/reference.md +3 -3
  48. package/templates/skills/hai-reach/SKILL.md +1 -1
  49. package/templates/skills/hai-reldb/SKILL.md +1 -1
  50. package/templates/skills/hai-reldb/reference.md +2 -3
  51. package/templates/skills/hai-scheduler/reference.md +1 -1
  52. package/templates/skills/hai-serv/SKILL.md +1 -1
  53. package/templates/skills/hai-serv/reference.md +2 -2
  54. package/templates/skills/hai-storage/SKILL.md +1 -0
  55. package/templates/skills/hai-storage/reference.md +14 -4
  56. package/templates/skills/hai-vecdb/reference.md +1 -1
  57. package/dist/chunk-2ZL5ORQ2.js.map +0 -1
  58. package/dist/chunk-L53P43B2.js.map +0 -1
  59. package/dist/cli-config-templates-LWMD2I6V.js +0 -5
  60. package/templates/skills/hai-deploy/credentials.md +0 -19
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { generateConfigFile, runtimeEnvironmentVariables, renderEnvironment, generateProductionEnvironment, moduleEnvironmentVariables, documentConfig, parameterizeConfig } from './chunk-L53P43B2.js';
3
- import { cliM } from './chunk-2ZL5ORQ2.js';
2
+ import { generateConfigFile, runtimeEnvironmentVariables, renderEnvironment, generateProductionEnvironment, moduleEnvironmentVariables, documentConfig, parameterizeConfig } from './chunk-V7WGSBX3.js';
3
+ import { cliM } from './chunk-P2VZ3VV6.js';
4
4
  import { __commonJS, __export, __toESM } from './chunk-ZSDEVXZ7.js';
5
- import process15 from 'process';
5
+ import process14 from 'process';
6
6
  import { cac } from 'cac';
7
7
  import chalk from 'chalk';
8
8
  import path2, { resolve, dirname, join, relative, basename, sep, isAbsolute, extname } from 'path';
@@ -18,7 +18,7 @@ import { Buffer, constants as constants$1 } from 'buffer';
18
18
  import { execSync, execFileSync, spawn } from 'child_process';
19
19
  import { randomBytes, createECDH, randomUUID, createHash } from 'crypto';
20
20
  import { readFileSync, existsSync, mkdirSync, mkdtempSync, appendFileSync, createReadStream, writeFileSync, renameSync, rmSync, statSync, cpSync, realpathSync, lstatSync, unlinkSync, openSync, constants, fstatSync, readSync, closeSync, readdirSync, fchmodSync, fsyncSync } from 'fs';
21
- import { core, CoreConfigSchema, ok, err, HaiCommonError } from '@h-ai/core';
21
+ import { core, LogLevelSchema, CoreConfigSchema, ok, err, HaiCommonError } from '@h-ai/core';
22
22
  import { tmpdir } from 'os';
23
23
  import 'https';
24
24
  import 'tls';
@@ -2203,7 +2203,7 @@ var require_sm2 = __commonJS({
2203
2203
  const decodeDerObj = decodeDer(signHex);
2204
2204
  r = decodeDerObj.r;
2205
2205
  s = decodeDerObj.s;
2206
- } catch (err31) {
2206
+ } catch (err30) {
2207
2207
  return false;
2208
2208
  }
2209
2209
  } else {
@@ -2873,21 +2873,21 @@ var require_src = __commonJS({
2873
2873
  var CAMEL_CASE_SEPARATOR_REGEX = /[-_\s]+(.)?/g;
2874
2874
  var LEADING_CHAR_REGEX = /^./;
2875
2875
  function writeCliMessage(message) {
2876
- process15.stdout.write(`${message}
2876
+ process14.stdout.write(`${message}
2877
2877
  `);
2878
2878
  }
2879
2879
  function writeCliError(message, error62) {
2880
- process15.stderr.write(`${message}
2880
+ process14.stderr.write(`${message}
2881
2881
  `);
2882
2882
  if (error62 && typeof error62 === "object" && "error" in error62)
2883
2883
  error62 = error62.error;
2884
2884
  if (error62 !== void 0) {
2885
- process15.stderr.write(`${error62 instanceof Error ? error62.message : String(error62)}
2885
+ process14.stderr.write(`${error62 instanceof Error ? error62.message : String(error62)}
2886
2886
  `);
2887
2887
  }
2888
2888
  }
2889
2889
  function formatPromptDescription(description) {
2890
- return wrapAnsi(description, Math.max(1, (process15.stdout.columns || 80) - 32), { hard: true });
2890
+ return wrapAnsi(description, Math.max(1, (process14.stdout.columns || 80) - 32), { hard: true });
2891
2891
  }
2892
2892
  function toCamelCase(str) {
2893
2893
  return str.replace(CAMEL_CASE_SEPARATOR_REGEX, (_, c) => c ? c.toUpperCase() : "").replace(LEADING_CHAR_REGEX, (c) => c.toLowerCase());
@@ -2967,6 +2967,7 @@ function registerHelpers() {
2967
2967
  }
2968
2968
  registerHelpers();
2969
2969
  Handlebars2.registerHelper("deploymentConfig", () => JSON.stringify(parse(generateConfigFile("deploy")), null, 2));
2970
+ Handlebars2.registerHelper("nginxDownloadErrors", (scope) => fse.readFileSync(path2.join(getTemplatesRoot(), "shared", "download-error", `${scope}.conf`), "utf8"));
2970
2971
  Handlebars2.registerHelper("if_eq", function(a, b, options) {
2971
2972
  return a === b ? options.fn(this) : options.inverse(this);
2972
2973
  });
@@ -4151,14 +4152,6 @@ var PROJECT_NAME_REGEX = /^[a-z0-9-]+$/;
4151
4152
  async function createProject(options) {
4152
4153
  const spinner = ora();
4153
4154
  try {
4154
- if ([
4155
- "template",
4156
- "features",
4157
- "examples",
4158
- "yes"
4159
- ].some((key) => Object.hasOwn(options, key))) {
4160
- throw new Error(cliM("cli_createOptionsRemoved"));
4161
- }
4162
4155
  const resolvedOptions = await resolveOptions(options);
4163
4156
  if (!PROJECT_NAME_REGEX.test(resolvedOptions.name)) {
4164
4157
  throw new Error(cliM("cli_createInvalidName", {
@@ -4200,7 +4193,7 @@ async function createProject(options) {
4200
4193
  });
4201
4194
  await generateFromTemplates(projectPath, context);
4202
4195
  {
4203
- const { generateConfigFile: generateConfigFile2, generateEnvExample, generateProductionEnvironment: generateProductionEnvironment2 } = await import('./cli-config-templates-LWMD2I6V.js');
4196
+ const { generateConfigFile: generateConfigFile2, generateEnvExample, generateProductionEnvironment: generateProductionEnvironment2 } = await import('./cli-config-templates-VLXJTHCQ.js');
4204
4197
  const configs = resolvedOptions.moduleConfigs;
4205
4198
  const isApiWorkspace = resolvedOptions.appType === "api";
4206
4199
  const isFullstack = resolvedOptions.appType === "fullstack";
@@ -4327,7 +4320,7 @@ HAI_CRYPTO_TRANSPORT_SERVERKEYRING='${JSON.stringify(ring)}'
4327
4320
  }
4328
4321
  await fse.writeFile(path2.join(envDirectory, ".env.local"), "# \u672C\u673A\u901A\u7528\u79C1\u6709\u8986\u76D6\uFF0C\u4E0D\u63D0\u4EA4 Git\uFF1B\u521D\u59CB\u5BC6\u7801\u548C\u4F20\u8F93\u5BC6\u94A5\u73AF\u5206\u522B\u4F4D\u4E8E .env.dev.local / .env.test.local / .env.prod.local\u3002\n", { mode: 384 });
4329
4322
  }
4330
- const { generateSkillFiles } = await import('./cli-skill-templates-D6S2OQ6X.js');
4323
+ const { generateSkillFiles } = await import('./cli-skill-templates-JKF6E3PI.js');
4331
4324
  await generateSkillFiles(
4332
4325
  projectPath,
4333
4326
  resolvedOptions.features,
@@ -4385,7 +4378,7 @@ async function resolveOptions(options) {
4385
4378
  writeCliMessage("");
4386
4379
  const onCancel = () => {
4387
4380
  writeCliMessage(chalk.red(cliM("cli_cancelledLine")));
4388
- process15.exit(1);
4381
+ process14.exit(1);
4389
4382
  };
4390
4383
  let projectName = options.name;
4391
4384
  if (!projectName && useDefaults) {
@@ -4597,7 +4590,7 @@ async function promptModuleConfigs(features, projectName) {
4597
4590
  const configs = {};
4598
4591
  const onCancel = () => {
4599
4592
  writeCliMessage(chalk.red(cliM("cli_cancelledLine")));
4600
- process15.exit(1);
4593
+ process14.exit(1);
4601
4594
  };
4602
4595
  writeCliMessage("");
4603
4596
  writeCliMessage(chalk.bold(cliM("cli_createModuleConfig")));
@@ -4938,7 +4931,7 @@ function generateBuildDeploymentReadme(pm, appDir) {
4938
4931
  return `### \u6784\u5EFA\u4E0E\u90E8\u7F72
4939
4932
 
4940
4933
  \u521B\u5EFA\u65F6\u9ED8\u8BA4\u5305\u542B\u90E8\u7F72\u5DE5\u5177\uFF1B\u4E0D\u9700\u8981\u65F6\u4F7F\u7528 hai create --no-deploy\u3002
4941
- \u540E\u7AEFserv\u3001\u6D4F\u89C8\u5668\u7AD9\u70B9web\uFF08\u9759\u6001\u6216SSR\uFF09\u3001\u624B\u673A\u539F\u751F\u5305app\u3001\u684C\u9762\u539F\u751F\u5305desktop\u3002--images/--services\u4F7F\u7528serv/web\uFF0C--target app/desktop\u7528\u4E8E\u539F\u751F\u4EA4\u4ED8\u3002\u955C\u50CF\u548C\u5BB9\u5668\u8EAB\u4EFD\u53D6\u5DE5\u7A0B\u6839package.json.name\uFF0C\u53BBscope\u3001\u8F6C\u5C0F\u5199\u5E76\u5F52\u4E00\u5316\u5B57\u7B26\uFF1B\u7F3A\u5931\u6216\u65E0\u6548\u65F6\u62A5\u9519\uFF0C\u4E0D\u4F7F\u7528\u76EE\u5F55\u540D\u3002\u6839\u76EE\u5F55\u5236\u54C1\u683C\u5F0F4\uFF0C\u975E\u6839\u76EE\u5F55\u683C\u5F0F5\u53CAwebBasePath\uFF0C\u4E24\u8005\u90FD\u8BB0\u5F55primaryService/hasWeb\uFF1B\u53EA\u6709serv + web\u751F\u6210\u540C\u6E90API\u4EE3\u7406\u3002\u65E7\u5DE5\u7A0B\u5148\u540C\u6B65build.images\u3001Dockerfile\u53CAAPI workspace\u7684-serv\u5305\u540D\u4E0E\u5F15\u7528\uFF0C\u5B89\u88C5\u4F9D\u8D56\u5E76\u91CD\u5EFA\u5B8C\u6574\u5236\u54C1\uFF1B\u65E7\u90E8\u7F72\u5148\u5907\u4EFD\u3001\u6838\u5BF9\u9879\u76EE\u540D\u3001\u5377\u4E0E\u53D7\u7BA1\u51ED\u636E\uFF0C\u518D\u5EFA\u7ACB\u5B8C\u6574\u57FA\u7EBF\u3002\u5B8C\u6574\u90E8\u7F72\u6309Compose\u89C4\u5219\u6E05\u7406\u540C\u9879\u76EE\u65E7\u670D\u52A1\uFF0C\u4E0D\u81EA\u52A8\u8DE8\u9879\u76EE\u8FC1\u79FB\u6570\u636E\u3002
4934
+ \u540E\u7AEFserv\u3001\u6D4F\u89C8\u5668\u7AD9\u70B9web\uFF08\u9759\u6001\u6216SSR\uFF09\u3001\u624B\u673A\u539F\u751F\u5305app\u3001\u684C\u9762\u539F\u751F\u5305desktop\u3002--images/--services\u4F7F\u7528serv/web\uFF0C--target app/desktop\u7528\u4E8E\u539F\u751F\u4EA4\u4ED8\u3002\u955C\u50CF\u548C\u5BB9\u5668\u8EAB\u4EFD\u53D6\u5DE5\u7A0B\u6839package.json.name\uFF0C\u53BBscope\u3001\u8F6C\u5C0F\u5199\u5E76\u5F52\u4E00\u5316\u5B57\u7B26\uFF1B\u7F3A\u5931\u6216\u65E0\u6548\u65F6\u62A5\u9519\uFF0C\u4E0D\u4F7F\u7528\u76EE\u5F55\u540D\u3002\u955C\u50CF\u5236\u54C1\u4F7F\u7528\u683C\u5F0F 5\uFF0C\u8BB0\u5F55 primaryService\u3001hasWeb \u548C webBasePath\uFF1B\u57DF\u540D\u6839\u76EE\u5F55\u7684 webBasePath \u4E3A\u7A7A\u5B57\u7B26\u4E32\u3002\u53EA\u6709\u540C\u65F6\u5305\u542B serv \u4E0E web \u65F6\u624D\u751F\u6210\u540C\u6E90 API \u4EE3\u7406\u3002\u5B8C\u6574\u90E8\u7F72\u6309 Compose \u9879\u76EE\u66F4\u65B0\u5BB9\u5668\u5E76\u4FDD\u7559\u6570\u636E\u5377\u3002
4942
4935
 
4943
4936
  \u7F51\u7AD9\u5730\u5740\u542B/yyy/\u7B49\u76EE\u5F55\u65F6\uFF0C\u5728\u6784\u5EFA\u8FDB\u7A0B\u663E\u5F0F\u8BBE\u7F6EPUBLIC_BASE_PATH=/yyy\uFF0C\u9ED8\u8BA4\u7A7A\u5B57\u7B26\u4E32\uFF1B\u4E0D\u4ECE\u79C1\u6709dotenv\u8BFB\u53D6\u3002SvelteKit\u7F16\u8BD1\u65F6\u56FA\u5B9Abase\uFF0CVite\u9ED8\u8BA4\u76F8\u5BF9\u8D44\u6E90\u4E0Ehash\u8DEF\u7531\uFF1BAPI\u5730\u5740\u72EC\u7ACB\u914D\u7F6E\u3002Docker\u7F51\u7AD9\u5236\u54C1\u7531SDK\u5904\u7406\u4EE3\u7406\u4E0E\u5065\u5EB7\u8DEF\u5F84\uFF0C\u4F7F\u7528\u5339\u914DCLI/Deploy\uFF1B\u6240\u6709\u90E8\u5206\u6784\u5EFA\u4FDD\u6301\u540C\u4E00\u76EE\u5F55\uFF0C\u5373\u4F7F\u53EA\u6784\u5EFAserv\u3002\u76EE\u5F55\u53D8\u5316\u4F7F\u7528\u5168\u91CF\u90E8\u7F72\uFF0C\u64CD\u4F5C\u548C\u9A8C\u8BC1\u89C1[\u7F51\u7AD9\u6302\u8F7D\u76EE\u5F55](.agents/skills/hai-build/paths.md)\u3002
4944
4937
 
@@ -5490,7 +5483,7 @@ async function addModule(options) {
5490
5483
  ...baseDefinition,
5491
5484
  deps: resolveFeatureDependencies([selected]).filter((feature) => feature !== selected)
5492
5485
  };
5493
- const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-D6S2OQ6X.js');
5486
+ const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-JKF6E3PI.js');
5494
5487
  const allPackages = new Set(moduleDef.packages);
5495
5488
  for (const dep of moduleDef.deps) {
5496
5489
  for (const name of MODULE_MAP[dep]?.packages ?? [])
@@ -7059,10 +7052,10 @@ function defineLazyInternal(inst, key, compute) {
7059
7052
  Object.defineProperty(this, key, { configurable: true, writable: true, value });
7060
7053
  broke = broke || outer;
7061
7054
  return value;
7062
- } catch (err31) {
7055
+ } catch (err30) {
7063
7056
  delete this[key];
7064
7057
  broke = broke || outer;
7065
- throw err31;
7058
+ throw err30;
7066
7059
  }
7067
7060
  },
7068
7061
  set(value) {
@@ -10726,7 +10719,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
10726
10719
  var NONE = 0;
10727
10720
  var ASSUMED = 1;
10728
10721
  var PROVEN = 2;
10729
- function isRecursive(inst, stack, resolve17) {
10722
+ function isRecursive(inst, stack, resolve15) {
10730
10723
  const cached2 = recursive.get(inst);
10731
10724
  if (cached2 !== void 0)
10732
10725
  return cached2 ? PROVEN : NONE;
@@ -10736,7 +10729,7 @@ function isRecursive(inst, stack, resolve17) {
10736
10729
  let result = NONE;
10737
10730
  const check2 = (child) => {
10738
10731
  if (result !== PROVEN && child?._zod) {
10739
- const answer = isRecursive(child, stack, resolve17);
10732
+ const answer = isRecursive(child, stack, resolve15);
10740
10733
  if (answer > result)
10741
10734
  result = answer;
10742
10735
  }
@@ -10747,7 +10740,7 @@ function isRecursive(inst, stack, resolve17) {
10747
10740
  const desc = Object.getOwnPropertyDescriptor(sh, key);
10748
10741
  if (!desc.enumerable)
10749
10742
  continue;
10750
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve17) : NONE;
10743
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve15) : NONE;
10751
10744
  if (child > answer)
10752
10745
  answer = child;
10753
10746
  }
@@ -10811,7 +10804,7 @@ function isRecursive(inst, stack, resolve17) {
10811
10804
  break;
10812
10805
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
10813
10806
  case "lazy": {
10814
- const inner = def._cachedInner ?? (resolve17 ? inst._zod.innerType : void 0);
10807
+ const inner = def._cachedInner ?? (resolve15 ? inst._zod.innerType : void 0);
10815
10808
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
10816
10809
  break;
10817
10810
  }
@@ -18629,9 +18622,9 @@ function compile(schema, options) {
18629
18622
  const clone2 = withParser(schema, parser);
18630
18623
  clone2._zod.bag.validator = compileValidator(schema, parser);
18631
18624
  return clone2;
18632
- } catch (err31) {
18625
+ } catch (err30) {
18633
18626
  if (options?.strict)
18634
- throw err31;
18627
+ throw err30;
18635
18628
  return schema;
18636
18629
  }
18637
18630
  }
@@ -18721,8 +18714,8 @@ ${code}
18721
18714
  try {
18722
18715
  const factory = new F(...constantNames, factoryCode);
18723
18716
  fn = factory(...constantValues);
18724
- } catch (err31) {
18725
- throw new ZodCompileUnsupportedError(`this schema (generated code failed to evaluate: ${err31.message})`);
18717
+ } catch (err30) {
18718
+ throw new ZodCompileUnsupportedError(`this schema (generated code failed to evaluate: ${err30.message})`);
18726
18719
  }
18727
18720
  if (options?.debug) {
18728
18721
  fn.code = fullCode;
@@ -18760,9 +18753,9 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
18760
18753
  const varCounter = ctx.varCounter;
18761
18754
  try {
18762
18755
  return generateCheck(doc, ctx, schema, accessor, needsValue);
18763
- } catch (err31) {
18764
- if (!(err31 instanceof ZodCompileUnsupportedError) || !err31.islandable)
18765
- throw err31;
18756
+ } catch (err30) {
18757
+ if (!(err30 instanceof ZodCompileUnsupportedError) || !err30.islandable)
18758
+ throw err30;
18766
18759
  doc.content.length = contentLen;
18767
18760
  if (ctx.constants.size > constantCount) {
18768
18761
  const trailing = Array.from(ctx.constants.keys()).slice(constantCount);
@@ -25368,17 +25361,14 @@ function date4(params) {
25368
25361
  // ../deploy/src/deploy-artifact.ts
25369
25362
  external_exports.object({
25370
25363
  /** 清单格式版本,与应用版本和部署环境无关。 */
25371
- version: external_exports.union([
25372
- external_exports.literal(4),
25373
- external_exports.literal(5)
25374
- ]),
25364
+ version: external_exports.literal(5),
25375
25365
  /** 主运行服务:独立后端为 serv,独立浏览器站点(静态或 SSR)为 web。 */
25376
25366
  primaryService: external_exports.enum(["serv", "web"]),
25377
25367
  /** 应用根 package.json 的版本,用于归档、Compose 与桌面交付;最长 80 字符。 */
25378
25368
  appVersion: external_exports.string().max(80).regex(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9a-z-]+(?:\.[0-9a-z-]+)*)?(?:\+[0-9a-z-]+(?:\.[0-9a-z-]+)*)?$/i),
25379
25369
  /** 本次构建标识;同一应用版本允许重复构建。 */
25380
25370
  buildId: external_exports.string().max(128).regex(/^[a-z0-9][\w.+-]*$/i),
25381
- /** 构建启动时观察到的 Git 来源;历史清单可以省略。 */
25371
+ /** 构建启动时观察到的 Git 来源。 */
25382
25372
  source: external_exports.object({
25383
25373
  /** 工程 package.json 所在仓库的提交 SHA;无法确定时为 unknown。 */
25384
25374
  commit: external_exports.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64}|unknown)$/),
@@ -25389,8 +25379,8 @@ external_exports.object({
25389
25379
  partial: external_exports.boolean().default(false),
25390
25380
  /** 是否包含浏览器端;仅构建 serv 时也保留完整工程的 Web 拓扑。 */
25391
25381
  hasWeb: external_exports.boolean().default(false),
25392
- /** Web构建的公开挂载目录,无末尾斜杠;省略或空字符串保持域名根目录。增量制品须保留完整拓扑的同一值。 */
25393
- webBasePath: external_exports.string().refine((value) => value === "" || /^\/[\w.-]+(?:\/[\w.-]+)*$/.test(value) && !value.split("/").some((segment) => segment === "." || segment === "..")).optional(),
25382
+ /** Web 构建的公开挂载目录,无末尾斜杠;空字符串表示域名根目录。增量制品须保留完整拓扑的同一值。 */
25383
+ webBasePath: external_exports.string().refine((value) => value === "" || /^\/[\w.-]+(?:\/[\w.-]+)*$/.test(value) && !value.split("/").some((segment) => segment === "." || segment === "..")),
25394
25384
  /** 工程显式配置的后端端口,部分构建未包含 serv 时仍保留。 */
25395
25385
  servContainerPort: external_exports.number().int().min(1).max(65535).optional(),
25396
25386
  /** 工程显式配置的 Web 端口,部分构建未包含 web 镜像时仍保留;缺省使用部署默认值。 */
@@ -25405,12 +25395,12 @@ external_exports.object({
25405
25395
  imageRef: external_exports.string().regex(/^[a-z0-9][a-z0-9./:_-]*:[a-z0-9_][a-z0-9_.-]*$/).refine((value) => !value.endsWith(":latest")),
25406
25396
  /** tar 内容的 SHA-256,用于部署前校验。 */
25407
25397
  sha256: external_exports.string().regex(/^[a-f0-9]{64}$/),
25408
- /** 引擎实际构建的镜像 OS/架构;历史清单可以省略。 */
25398
+ /** 引擎实际构建的镜像 OS/架构。 */
25409
25399
  platform: external_exports.string().regex(/^[a-z0-9][a-z0-9_.-]*\/[a-z0-9][a-z0-9_.-]*$/).optional(),
25410
25400
  /** 容器内部监听端口;服务器公开端口由部署选择。 */
25411
25401
  containerPort: external_exports.number().int().min(1).max(65535).optional()
25412
25402
  })).min(1).max(2).refine((images) => new Set(images.map((image) => image.name)).size === images.length)
25413
- }).refine((artifact) => artifact.version === 5 ? !!artifact.webBasePath : !artifact.webBasePath).refine((artifact) => !artifact.webBasePath || artifact.hasWeb).refine((artifact) => artifact.images.every((image) => image.file === `${image.name}-${artifact.appVersion}.tar`)).refine((artifact) => artifact.primaryService !== "web" || artifact.hasWeb).refine((artifact) => artifact.images.every((image) => image.name === artifact.primaryService || image.name === "web" && artifact.hasWeb)).refine((artifact) => artifact.partial || artifact.images.some((image) => image.name === artifact.primaryService)).refine((artifact) => artifact.partial || !artifact.hasWeb || artifact.images.some((image) => image.name === "web"));
25403
+ }).refine((artifact) => !artifact.webBasePath || artifact.hasWeb).refine((artifact) => artifact.images.every((image) => image.file === `${image.name}-${artifact.appVersion}.tar`)).refine((artifact) => artifact.primaryService !== "web" || artifact.hasWeb).refine((artifact) => artifact.images.every((image) => image.name === artifact.primaryService || image.name === "web" && artifact.hasWeb)).refine((artifact) => artifact.partial || artifact.images.some((image) => image.name === artifact.primaryService)).refine((artifact) => artifact.partial || !artifact.hasWeb || artifact.images.some((image) => image.name === "web"));
25414
25404
 
25415
25405
  // ../deploy/messages/en-US.json
25416
25406
  var en_US_default = {
@@ -25520,9 +25510,7 @@ var en_US_default = {
25520
25510
  deploy_uploadPasswordCancelled: "Password input cancelled; no server connection was made.",
25521
25511
  deploy_uploadPasswordInvalid: "SSH passwords must contain 1\u20131023 UTF-8 bytes without line breaks.",
25522
25512
  deploy_managedSecretsInvalid: "Invalid generated middleware credential candidates. Rebuild the deployment bundle; server credentials will not be rotated automatically.",
25523
- deploy_secretImportFailed: "Legacy credential import was rejected during {phase}; check private input permissions, project/volume identity, live credentials and the deployment lock. No services were updated; inspect the protected state file if commit is unconfirmed",
25524
25513
  deploy_projectNameRequired: "The root package.json.name is missing or cannot be normalized into an image and deployment resource identity.",
25525
- deploy_projectNameOverrideRemoved: "Deployment identity comes from the root package.json.name; remove the obsolete projectName override.",
25526
25514
  deploy_requestAccessInvalid: "Invalid request access policy ({field}). Check fields, IP addresses, timezones and time windows. For a file reference, use readable YAML no larger than 1 MiB. Fix the configuration and create a new bundle.",
25527
25515
  deploy_httpsPortsInvalid: "HTTP and HTTPS ports must differ; Let\u2019s Encrypt HTTP-01 requires host port 80.",
25528
25516
  deploy_httpsCertificateInvalid: "Invalid HTTPS certificate. Check readable PEM files, matching unencrypted private key, validity dates and domain, then repackage.",
@@ -25552,7 +25540,9 @@ var en_US_default = {
25552
25540
  deploy_middlewareMethod: "Enter POST or PUT.",
25553
25541
  deploy_configResolutionFailed: "Cannot resolve {path}. Check the configuration structure and array indices for {fields}.",
25554
25542
  deploy_reachEmptyProviderOverride: "While resolving {path}, {field} refers to a missing provider because HAI_REACH_PROVIDERS is []. Remove stale indexed variables and set HAI_REACH_PROVIDERS to the complete notification provider list in .env.<environment>.local.",
25555
- deploy_s3Engine: "Choose the self-hosted S3 implementation"
25543
+ deploy_s3Engine: "Choose the self-hosted S3 implementation",
25544
+ deploy_downloadUnavailableTitle: "Download link unavailable",
25545
+ deploy_downloadUnavailableInstruction: "Return to the download page to get a new link. If the download still fails, contact your administrator."
25556
25546
  };
25557
25547
 
25558
25548
  // ../deploy/messages/ja-JP.json
@@ -25663,9 +25653,7 @@ var ja_JP_default = {
25663
25653
  deploy_uploadPasswordCancelled: "\u30D1\u30B9\u30EF\u30FC\u30C9\u5165\u529B\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002\u30B5\u30FC\u30D0\u30FC\u306B\u306F\u672A\u63A5\u7D9A\u3067\u3059\u3002",
25664
25654
  deploy_uploadPasswordInvalid: "SSH \u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u6539\u884C\u3092\u542B\u307E\u306A\u3044 1\u20131023 UTF-8 \u30D0\u30A4\u30C8\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
25665
25655
  deploy_managedSecretsInvalid: "\u81EA\u5EFA\u30DF\u30C9\u30EB\u30A6\u30A7\u30A2\u306E\u5019\u88DC\u8A8D\u8A3C\u60C5\u5831\u304C\u7121\u52B9\u3067\u3059\u3002\u914D\u7F6E\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u518D\u751F\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B5\u30FC\u30D0\u30FC\u306E\u8A8D\u8A3C\u60C5\u5831\u306F\u81EA\u52D5\u5909\u66F4\u3055\u308C\u307E\u305B\u3093\u3002",
25666
- deploy_secretImportFailed: "\u65E7\u8A8D\u8A3C\u60C5\u5831\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u306F {phase} \u6BB5\u968E\u3067\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002\u5165\u529B\u6A29\u9650\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3068\u30DC\u30EA\u30E5\u30FC\u30E0\u3001\u5B9F\u969B\u306E\u8A8D\u8A3C\u60C5\u5831\u3001\u30C7\u30D7\u30ED\u30A4\u30ED\u30C3\u30AF\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B5\u30FC\u30D3\u30B9\u306F\u66F4\u65B0\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u78BA\u5B9A\u304C\u4E0D\u660E\u306A\u5834\u5408\u306F\u4FDD\u8B77\u3055\u308C\u305F\u72B6\u614B\u30D5\u30A1\u30A4\u30EB\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",
25667
25656
  deploy_projectNameRequired: "\u5DE5\u7A0B\u30EB\u30FC\u30C8\u306E package.json.name \u304C\u306A\u3044\u304B\u6B63\u898F\u5316\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30A4\u30E1\u30FC\u30B8\u3068\u30C7\u30D7\u30ED\u30A4\u30EA\u30BD\u30FC\u30B9\u306E\u8B58\u5225\u540D\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093\u3002",
25668
- deploy_projectNameOverrideRemoved: "\u30C7\u30D7\u30ED\u30A4\u8B58\u5225\u540D\u306F\u5DE5\u7A0B\u30EB\u30FC\u30C8\u306E package.json.name \u304B\u3089\u53D6\u5F97\u3057\u307E\u3059\u3002\u65E7 projectName \u4E0A\u66F8\u304D\u5F15\u6570\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
25669
25657
  deploy_requestAccessInvalid: "\u30EA\u30AF\u30A8\u30B9\u30C8\u30A2\u30AF\u30BB\u30B9\u8A2D\u5B9A\uFF08{field}\uFF09\u304C\u7121\u52B9\u3067\u3059\u3002\u30D5\u30A3\u30FC\u30EB\u30C9\u3001IP\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u3001\u6642\u9593\u5E2F\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D5\u30A1\u30A4\u30EB\u306F\u8AAD\u307F\u53D6\u308A\u53EF\u80FD\u306A 1 MiB \u4EE5\u4E0B\u306E YAML \u3092\u6307\u5B9A\u3057\u3001\u4FEE\u6B63\u5F8C\u306B\u518D\u30D1\u30C3\u30B1\u30FC\u30B8\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
25670
25658
  deploy_httpsPortsInvalid: "HTTP \u3068 HTTPS \u306E\u30DD\u30FC\u30C8\u306F\u7570\u306A\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002Let\u2019s Encrypt HTTP-01 \u306B\u306F\u30DB\u30B9\u30C8\u306E\u30DD\u30FC\u30C8 80 \u304C\u5FC5\u8981\u3067\u3059\u3002",
25671
25659
  deploy_httpsCertificateInvalid: "HTTPS \u8A3C\u660E\u66F8\u304C\u7121\u52B9\u3067\u3059\u3002PEM \u30D5\u30A1\u30A4\u30EB\u3001\u6697\u53F7\u5316\u3055\u308C\u3066\u3044\u306A\u3044\u79D8\u5BC6\u9375\u3068\u306E\u4E00\u81F4\u3001\u6709\u52B9\u671F\u9593\u3001\u30C9\u30E1\u30A4\u30F3\u3092\u78BA\u8A8D\u3057\u3001\u518D\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
@@ -25695,7 +25683,9 @@ var ja_JP_default = {
25695
25683
  deploy_middlewareMethod: "POST \u307E\u305F\u306F PUT \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
25696
25684
  deploy_configResolutionFailed: "{path} \u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002{fields} \u306B\u5BFE\u5FDC\u3059\u308B\u8A2D\u5B9A\u306E\u69CB\u9020\u3068\u914D\u5217\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
25697
25685
  deploy_reachEmptyProviderOverride: "{path} \u306E\u6709\u52B9\u306A\u8A2D\u5B9A\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002HAI_REACH_PROVIDERS \u304C [] \u306E\u305F\u3081\u3001{field} \u306B\u5BFE\u5FDC\u3059\u308B\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u53E4\u3044\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u4ED8\u304D\u5909\u6570\u3092\u524A\u9664\u3057\u3001.env.<\u74B0\u5883>.local \u306E HAI_REACH_PROVIDERS \u306B\u901A\u77E5\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC\u306E\u5B8C\u5168\u306A\u4E00\u89A7\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
25698
- deploy_s3Engine: "\u30BB\u30EB\u30D5\u30DB\u30B9\u30C8 S3 \u306E\u5B9F\u88C5\u3092\u9078\u629E"
25686
+ deploy_s3Engine: "\u30BB\u30EB\u30D5\u30DB\u30B9\u30C8 S3 \u306E\u5B9F\u88C5\u3092\u9078\u629E",
25687
+ deploy_downloadUnavailableTitle: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30EA\u30F3\u30AF\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093",
25688
+ deploy_downloadUnavailableInstruction: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30DA\u30FC\u30B8\u306B\u623B\u308A\u3001\u65B0\u3057\u3044\u30EA\u30F3\u30AF\u3092\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u89E3\u6C7A\u3057\u306A\u3044\u5834\u5408\u306F\u7BA1\u7406\u8005\u306B\u304A\u554F\u3044\u5408\u308F\u305B\u304F\u3060\u3055\u3044\u3002"
25699
25689
  };
25700
25690
 
25701
25691
  // ../deploy/messages/zh-CN.json
@@ -25806,9 +25796,7 @@ var zh_CN_default2 = {
25806
25796
  deploy_uploadPasswordCancelled: "\u5DF2\u53D6\u6D88\u5BC6\u7801\u8F93\u5165\uFF0C\u5C1A\u672A\u8FDE\u63A5\u670D\u52A1\u5668\u3002",
25807
25797
  deploy_uploadPasswordInvalid: "SSH \u5BC6\u7801\u987B\u4E3A 1\u20131023 \u4E2A UTF-8 \u5B57\u8282\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u6362\u884C\u3002",
25808
25798
  deploy_managedSecretsInvalid: "\u81EA\u5EFA\u4E2D\u95F4\u4EF6\u5019\u9009\u51ED\u636E\u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u90E8\u7F72\u5305\uFF1B\u670D\u52A1\u5668\u51ED\u636E\u4E0D\u4F1A\u81EA\u52A8\u66F4\u6362\u3002",
25809
- deploy_secretImportFailed: "\u65E7\u51ED\u636E\u5BFC\u5165\u5728 {phase} \u9636\u6BB5\u88AB\u62D2\u7EDD\uFF1B\u8BF7\u6838\u5BF9\u79C1\u6709\u8F93\u5165\u6743\u9650\u3001\u9879\u76EE/\u5377\u8EAB\u4EFD\u3001\u5B9E\u9645\u670D\u52A1\u51ED\u636E\u53CA\u90E8\u7F72\u9501\uFF0C\u672A\u6267\u884C\u670D\u52A1\u66F4\u65B0\uFF1B\u63D0\u4EA4\u7ED3\u679C\u4E0D\u660E\u65F6\u8BF7\u6838\u5BF9\u53D7\u4FDD\u62A4\u7684\u72B6\u6001\u6587\u4EF6",
25810
25799
  deploy_projectNameRequired: "\u5DE5\u7A0B\u6839 package.json.name \u7F3A\u5931\u6216\u65E0\u6CD5\u5F52\u4E00\u5316\uFF0C\u4E0D\u80FD\u751F\u6210\u955C\u50CF\u4E0E\u90E8\u7F72\u8D44\u6E90\u8EAB\u4EFD\u3002",
25811
- deploy_projectNameOverrideRemoved: "\u90E8\u7F72\u9879\u76EE\u540D\u7EDF\u4E00\u6765\u81EA\u5DE5\u7A0B\u6839 package.json.name\uFF1B\u8BF7\u79FB\u9664\u65E7 projectName \u8986\u76D6\u53C2\u6570\u3002",
25812
25800
  deploy_requestAccessInvalid: "\u8BF7\u6C42\u8BBF\u95EE\u7B56\u7565\u914D\u7F6E\u65E0\u6548\uFF08{field}\uFF09\u3002\u8BF7\u68C0\u67E5\u5B57\u6BB5\u3001IP\u3001\u65F6\u533A\u53CA\u65F6\u95F4\u7A97\u53E3\uFF1B\u5982\u5F15\u7528\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u53EF\u8BFB\u3001\u683C\u5F0F\u4E3A YAML \u4E14\u4E0D\u8D85\u8FC7 1 MiB\u3002\u4FEE\u6B63\u540E\u91CD\u65B0\u6253\u5305\u3002",
25813
25801
  deploy_httpsPortsInvalid: "HTTP \u4E0E HTTPS \u7AEF\u53E3\u5FC5\u987B\u4E0D\u540C\uFF1BLet\u2019s Encrypt \u7684 HTTP-01 \u5165\u53E3\u5FC5\u987B\u4F7F\u7528\u5BBF\u4E3B\u673A 80 \u7AEF\u53E3\u3002",
25814
25802
  deploy_httpsCertificateInvalid: "HTTPS \u8BC1\u4E66\u65E0\u6548\uFF1A\u8BF7\u6838\u5BF9 PEM \u6587\u4EF6\u53EF\u8BFB\u3001\u8BC1\u4E66\u4E0E\u672A\u52A0\u5BC6\u79C1\u94A5\u5339\u914D\u3001\u8BC1\u4E66\u6709\u6548\u671F\u53CA\u57DF\u540D\uFF0C\u7136\u540E\u91CD\u65B0\u6253\u5305\u3002",
@@ -25838,7 +25826,9 @@ var zh_CN_default2 = {
25838
25826
  deploy_middlewareMethod: "\u8BF7\u8F93\u5165 POST \u6216 PUT\u3002",
25839
25827
  deploy_configResolutionFailed: "\u65E0\u6CD5\u89E3\u6790 {path}\u3002\u8BF7\u68C0\u67E5 {fields} \u5BF9\u5E94\u7684\u914D\u7F6E\u7ED3\u6784\u4E0E\u6570\u7EC4\u7D22\u5F15\u3002",
25840
25828
  deploy_reachEmptyProviderOverride: "\u89E3\u6790 {path} \u7684\u751F\u6548\u914D\u7F6E\u65F6\u53D1\u73B0 {field} \u6307\u5411\u4E0D\u5B58\u5728\u7684 Provider\u3002HAI_REACH_PROVIDERS \u5F53\u524D\u4E3A []\u3002\u8BF7\u5220\u9664\u65E7\u7684\u7D22\u5F15\u53D8\u91CF\uFF0C\u5E76\u5728 .env.<\u73AF\u5883>.local \u4E2D\u7528 HAI_REACH_PROVIDERS \u914D\u7F6E\u5B8C\u6574\u7684\u901A\u77E5 Provider \u5217\u8868\u3002",
25841
- deploy_s3Engine: "\u9009\u62E9\u81EA\u5EFA S3 \u670D\u52A1\u5B9E\u73B0"
25829
+ deploy_s3Engine: "\u9009\u62E9\u81EA\u5EFA S3 \u670D\u52A1\u5B9E\u73B0",
25830
+ deploy_downloadUnavailableTitle: "\u4E0B\u8F7D\u94FE\u63A5\u65E0\u6CD5\u8BBF\u95EE",
25831
+ deploy_downloadUnavailableInstruction: "\u8BF7\u8FD4\u56DE\u4E0B\u8F7D\u9875\u9762\u91CD\u65B0\u83B7\u53D6\u94FE\u63A5\u3002\u82E5\u4ECD\u65E0\u6CD5\u4E0B\u8F7D\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002"
25842
25832
  };
25843
25833
 
25844
25834
  // ../deploy/src/deploy-i18n.ts
@@ -26115,7 +26105,7 @@ function resolveImageReference(reference, source) {
26115
26105
  return `${url2.host}${url2.pathname.replace(/\/$/, "")}/${parts.join("/")}`;
26116
26106
  }
26117
26107
  function systemProxy() {
26118
- if (process15.platform === "win32") {
26108
+ if (process14.platform === "win32") {
26119
26109
  const script = "$p=Get-ItemProperty -LiteralPath 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings'; @{enabled=($p.ProxyEnable -eq 1);server=$p.ProxyServer;bypass=$p.ProxyOverride;pac=$p.AutoConfigURL}|ConvertTo-Json -Compress";
26120
26110
  const value = JSON.parse(execFileSync("powershell.exe", [
26121
26111
  "-NoProfile",
@@ -26134,7 +26124,7 @@ function systemProxy() {
26134
26124
  bypass: value.bypass?.split(";").filter((item) => item !== "<local>").join(",")
26135
26125
  };
26136
26126
  }
26137
- if (process15.platform === "darwin") {
26127
+ if (process14.platform === "darwin") {
26138
26128
  const output2 = execFileSync("/usr/sbin/scutil", ["--proxy"], { encoding: "utf8", timeout: 5e3 });
26139
26129
  const get = (key) => output2.match(new RegExp(`^\\s*${key}\\s*:\\s*(.+)$`, "m"))?.[1]?.trim();
26140
26130
  if (get("ProxyAutoConfigEnable") === "1" || get("ProxyAutoDiscoveryEnable") === "1")
@@ -26150,7 +26140,7 @@ function resolveDownloadProxy(config2) {
26150
26140
  const mode = config2?.mode ?? "inherit";
26151
26141
  if (!["inherit", "system", "custom", "none"].includes(mode) || config2?.url !== void 0 && mode !== "custom")
26152
26142
  throw new Error(deployM("deploy_downloadInvalid"));
26153
- const values = mode === "system" ? systemProxy() : mode === "custom" ? { http: config2?.url, https: config2?.url } : mode === "inherit" ? { http: process15.env.HTTP_PROXY ?? process15.env.http_proxy, https: process15.env.HTTPS_PROXY ?? process15.env.https_proxy, bypass: process15.env.NO_PROXY ?? process15.env.no_proxy } : {};
26143
+ const values = mode === "system" ? systemProxy() : mode === "custom" ? { http: config2?.url, https: config2?.url } : mode === "inherit" ? { http: process14.env.HTTP_PROXY ?? process14.env.http_proxy, https: process14.env.HTTPS_PROXY ?? process14.env.https_proxy, bypass: process14.env.NO_PROXY ?? process14.env.no_proxy } : {};
26154
26144
  if (mode === "custom" && !config2?.url)
26155
26145
  throw new Error(deployM("deploy_downloadInvalid"));
26156
26146
  const normalize = (value) => {
@@ -26177,10 +26167,10 @@ function resolveDownloadProxy(config2) {
26177
26167
  https_proxy: https,
26178
26168
  NO_PROXY: bypass,
26179
26169
  no_proxy: bypass,
26180
- ALL_PROXY: mode === "inherit" ? process15.env.ALL_PROXY ?? process15.env.all_proxy ?? "" : "",
26181
- all_proxy: mode === "inherit" ? process15.env.ALL_PROXY ?? process15.env.all_proxy ?? "" : "",
26182
- FTP_PROXY: mode === "inherit" ? process15.env.FTP_PROXY ?? process15.env.ftp_proxy ?? "" : "",
26183
- ftp_proxy: mode === "inherit" ? process15.env.FTP_PROXY ?? process15.env.ftp_proxy ?? "" : ""
26170
+ ALL_PROXY: mode === "inherit" ? process14.env.ALL_PROXY ?? process14.env.all_proxy ?? "" : "",
26171
+ all_proxy: mode === "inherit" ? process14.env.ALL_PROXY ?? process14.env.all_proxy ?? "" : "",
26172
+ FTP_PROXY: mode === "inherit" ? process14.env.FTP_PROXY ?? process14.env.ftp_proxy ?? "" : "",
26173
+ ftp_proxy: mode === "inherit" ? process14.env.FTP_PROXY ?? process14.env.ftp_proxy ?? "" : ""
26184
26174
  };
26185
26175
  }
26186
26176
  function normalizeProjectName(name) {
@@ -27037,6 +27027,7 @@ var en_US_default2 = {
27037
27027
  crypto_transportBodyLimitInvalid: "Transport plaintext limit must be an integer between 1024 and 67108864 bytes",
27038
27028
  crypto_transportBodyTooLarge: "Encrypted transport payload exceeds the configured byte limit",
27039
27029
  crypto_transportTimeInvalid: "Your device and server clocks may be out of sync, or the request has expired. Enable automatic time synchronization or set your device time manually, then refresh to retry. If this continues, ask an administrator to check the server clock.",
27030
+ crypto_transportTimeResponseInvalid: "Transport time validation response is missing a valid server timestamp",
27040
27031
  crypto_transportTimeInvalidWithServerTime: "Your device and server clocks may be out of sync, or the request has expired. Server time is {serverTime}. Enable automatic time synchronization or set your device time manually, then refresh to retry. If this continues, ask an administrator to check the server clock.",
27041
27032
  crypto_transportTimeConfigInvalid: "Invalid transport time settings. Future clock skew must be an integer from 0 to 300 seconds and request lifetime from 1 to 600 seconds.",
27042
27033
  crypto_transportBodyLimitConflict: "Explicit transport limit {limit} bytes is below the enabled module requirement of {required} bytes; adjust the module budget or explicit limit",
@@ -27099,6 +27090,7 @@ var ja_JP_default2 = {
27099
27090
  crypto_transportBodyLimitInvalid: "\u901A\u4FE1\u5E73\u6587\u306E\u4E0A\u9650\u306F 1024 \u304B\u3089 67108864 \u30D0\u30A4\u30C8\u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",
27100
27091
  crypto_transportBodyTooLarge: "\u6697\u53F7\u5316\u901A\u4FE1\u306E\u30C7\u30FC\u30BF\u304C\u8A2D\u5B9A\u3055\u308C\u305F\u30D0\u30A4\u30C8\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059",
27101
27092
  crypto_transportTimeInvalid: "\u7AEF\u672B\u3068\u30B5\u30FC\u30D0\u30FC\u306E\u6642\u523B\u304C\u540C\u671F\u3057\u3066\u3044\u306A\u3044\u304B\u3001\u8981\u6C42\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u7AEF\u672B\u306E\u81EA\u52D5\u6642\u523B\u540C\u671F\u3092\u6709\u52B9\u306B\u3059\u308B\u304B\u3001\u624B\u52D5\u3067\u6642\u523B\u3092\u8A2D\u5B9A\u3057\u3066\u304B\u3089\u3001\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F\u7BA1\u7406\u8005\u306B\u30B5\u30FC\u30D0\u30FC\u306E\u6642\u523B\u78BA\u8A8D\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
27093
+ crypto_transportTimeResponseInvalid: "\u6697\u53F7\u5316\u901A\u4FE1\u306E\u6642\u523B\u691C\u8A3C\u5FDC\u7B54\u306B\u6709\u52B9\u306A\u30B5\u30FC\u30D0\u30FC\u6642\u523B\u304C\u3042\u308A\u307E\u305B\u3093",
27102
27094
  crypto_transportTimeInvalidWithServerTime: "\u7AEF\u672B\u3068\u30B5\u30FC\u30D0\u30FC\u306E\u6642\u523B\u304C\u540C\u671F\u3057\u3066\u3044\u306A\u3044\u304B\u3001\u8981\u6C42\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u30B5\u30FC\u30D0\u30FC\u6642\u523B\u306F {serverTime} \u3067\u3059\u3002\u7AEF\u672B\u306E\u81EA\u52D5\u6642\u523B\u540C\u671F\u3092\u6709\u52B9\u306B\u3059\u308B\u304B\u3001\u624B\u52D5\u3067\u6642\u523B\u3092\u8A2D\u5B9A\u3057\u3066\u304B\u3089\u3001\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F\u7BA1\u7406\u8005\u306B\u30B5\u30FC\u30D0\u30FC\u306E\u6642\u523B\u78BA\u8A8D\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
27103
27095
  crypto_transportTimeConfigInvalid: "\u30C8\u30E9\u30F3\u30B9\u30DD\u30FC\u30C8\u306E\u6642\u523B\u8A2D\u5B9A\u304C\u7121\u52B9\u3067\u3059\u3002\u672A\u6765\u65B9\u5411\u306E\u6642\u523B\u5DEE\u306F 0\uFF5E300 \u79D2\u3001\u8981\u6C42\u306E\u6709\u52B9\u671F\u9593\u306F 1\uFF5E600 \u79D2\u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
27104
27096
  crypto_transportBodyLimitConflict: "\u660E\u793A\u3055\u308C\u305F\u8EE2\u9001\u4E0A\u9650 {limit} \u30D0\u30A4\u30C8\u306F\u6709\u52B9\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u5FC5\u8981\u91CF {required} \u30D0\u30A4\u30C8\u672A\u6E80\u3067\u3059\u3002\u4E88\u7B97\u307E\u305F\u306F\u4E0A\u9650\u3092\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044",
@@ -27161,6 +27153,7 @@ var zh_CN_default3 = {
27161
27153
  crypto_transportBodyLimitInvalid: "\u4F20\u8F93\u660E\u6587\u5BB9\u91CF\u5FC5\u987B\u662F 1024 \u5230 67108864 \u5B57\u8282\u4E4B\u95F4\u7684\u6574\u6570",
27162
27154
  crypto_transportBodyTooLarge: "\u52A0\u5BC6\u4F20\u8F93\u62A5\u6587\u8D85\u8FC7\u914D\u7F6E\u7684\u5B57\u8282\u4E0A\u9650",
27163
27155
  crypto_transportTimeInvalid: "\u8BBE\u5907\u4E0E\u670D\u52A1\u5668\u65F6\u95F4\u53EF\u80FD\u4E0D\u540C\u6B65\uFF0C\u6216\u8BF7\u6C42\u5DF2\u8FC7\u671F\u3002\u8BF7\u5F00\u542F\u8BBE\u5907\u7684\u81EA\u52A8\u6821\u65F6\u6216\u624B\u5DE5\u4FEE\u6539\u65F6\u95F4\uFF0C\u7136\u540E\u5237\u65B0\u91CD\u8BD5\u3002\u82E5\u4ECD\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u670D\u52A1\u5668\u65F6\u95F4\u3002",
27156
+ crypto_transportTimeResponseInvalid: "\u4F20\u8F93\u52A0\u5BC6\u65F6\u95F4\u6821\u9A8C\u54CD\u5E94\u7F3A\u5C11\u6709\u6548\u7684\u670D\u52A1\u5668\u65F6\u95F4",
27164
27157
  crypto_transportTimeInvalidWithServerTime: "\u8BBE\u5907\u4E0E\u670D\u52A1\u5668\u65F6\u95F4\u53EF\u80FD\u4E0D\u540C\u6B65\uFF0C\u6216\u8BF7\u6C42\u5DF2\u8FC7\u671F\u3002\u670D\u52A1\u5668\u65F6\u95F4\u4E3A {serverTime}\u3002\u8BF7\u5F00\u542F\u8BBE\u5907\u7684\u81EA\u52A8\u6821\u65F6\u6216\u624B\u5DE5\u4FEE\u6539\u65F6\u95F4\uFF0C\u7136\u540E\u5237\u65B0\u91CD\u8BD5\u3002\u82E5\u4ECD\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u670D\u52A1\u5668\u65F6\u95F4\u3002",
27165
27158
  crypto_transportTimeConfigInvalid: "\u4F20\u8F93\u65F6\u95F4\u914D\u7F6E\u65E0\u6548\u3002\u5141\u8BB8\u7684\u672A\u6765\u504F\u5DEE\u987B\u4E3A 0 \u81F3 300 \u79D2\u7684\u6574\u6570\uFF0C\u8BF7\u6C42\u6709\u6548\u671F\u987B\u4E3A 1 \u81F3 600 \u79D2\u7684\u6574\u6570\u3002",
27166
27159
  crypto_transportBodyLimitConflict: "\u663E\u5F0F\u4F20\u8F93\u4E0A\u9650 {limit} \u5B57\u8282\u5C0F\u4E8E\u5DF2\u542F\u7528\u6A21\u5757\u6240\u9700\u7684 {required} \u5B57\u8282\uFF1B\u8BF7\u8C03\u6574\u6A21\u5757\u9884\u7B97\u6216\u663E\u5F0F\u4E0A\u9650",
@@ -27586,29 +27579,6 @@ function required2(name, defaultValue, kind) {
27586
27579
  }
27587
27580
  ]
27588
27581
  });
27589
- var nameSchema = external_exports.string().regex(/^[a-z0-9][\w.-]{0,127}$/i);
27590
- var passwordSchema = external_exports.string().min(1).max(1024).refine((value) => Buffer.from(value, "utf8").toString("utf8") === value && [...value].every((character) => character.codePointAt(0) >= 32 && character.codePointAt(0) !== 127));
27591
- external_exports.strictObject({
27592
- version: external_exports.literal(1),
27593
- projectName: nameSchema,
27594
- credentials: external_exports.strictObject({
27595
- DB_PASSWORD: passwordSchema.optional(),
27596
- STORAGE_PASSWORD: passwordSchema.optional(),
27597
- LDAP_PASSWORD: passwordSchema.optional()
27598
- }),
27599
- services: external_exports.array(external_exports.strictObject({
27600
- service: external_exports.enum(["db", "vecdb", "storage", "ldap"]),
27601
- container: nameSchema,
27602
- kind: external_exports.enum(["postgresql", "mysql", "s3", "ldap"]),
27603
- volumes: external_exports.array(nameSchema).min(1).max(8),
27604
- username: external_exports.string().min(1).max(128).default("hai"),
27605
- database: external_exports.string().min(1).max(128).default("hai"),
27606
- bucket: external_exports.string().regex(/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/).default("hai"),
27607
- accessKeyId: external_exports.string().min(1).max(128).default("hai-storage"),
27608
- region: external_exports.string().regex(/^[a-z0-9-]+$/).default("us-east-1"),
27609
- bindDn: external_exports.string().min(1).max(512).default("cn=admin,dc=example,dc=org")
27610
- })).min(1).max(4)
27611
- });
27612
27582
  function resolveCoreInputs(environment) {
27613
27583
  const resolved = core.config.resolve({
27614
27584
  name: "core",
@@ -27627,7 +27597,7 @@ function resolveCoreInputs(environment) {
27627
27597
  );
27628
27598
  }
27629
27599
  function nativeNameEnvironment(envDir) {
27630
- let inputs = process15.env;
27600
+ let inputs = process14.env;
27631
27601
  let selectedMode;
27632
27602
  if (envDir) {
27633
27603
  selectedMode = /** @type {string | undefined} */
@@ -27681,7 +27651,7 @@ async function resolveBuildDownloads(directory, options) {
27681
27651
  const savedImage = object2(sources.image);
27682
27652
  const savedNpm = object2(sources.npm);
27683
27653
  const savedProxy = object2(build.proxy);
27684
- const interactive = !!process15.stdin.isTTY && !options.yes;
27654
+ const interactive = !!process14.stdin.isTTY && !options.yes;
27685
27655
  const choose = async (message, values) => {
27686
27656
  const answer = await prompts({
27687
27657
  type: "select",
@@ -27845,7 +27815,7 @@ async function preflightDownloadProxy(runtime, proxy, report = writeCliMessage)
27845
27815
  const environment = resolveDownloadProxy(proxy);
27846
27816
  for (const value of new Set([environment.HTTP_PROXY, environment.HTTPS_PROXY].filter(Boolean))) {
27847
27817
  const url2 = new URL(value);
27848
- await new Promise((resolve17, reject) => {
27818
+ await new Promise((resolve15, reject) => {
27849
27819
  const socket = connect({
27850
27820
  host: url2.hostname.replace(/^\[|\]$/g, ""),
27851
27821
  port: Number(url2.port || (url2.protocol === "https:" ? 443 : 80))
@@ -27853,7 +27823,7 @@ async function preflightDownloadProxy(runtime, proxy, report = writeCliMessage)
27853
27823
  socket.setTimeout(3e3);
27854
27824
  socket.once("connect", () => {
27855
27825
  socket.destroy();
27856
- resolve17();
27826
+ resolve15();
27857
27827
  });
27858
27828
  const fail = () => {
27859
27829
  socket.destroy();
@@ -28118,16 +28088,16 @@ async function buildContainerAndroid(root, apps, options, publish) {
28118
28088
  let keystore;
28119
28089
  if (!debug) {
28120
28090
  const values = {
28121
- HAI_ANDROID_STORE_PASSWORD: process15.env.HAI_ANDROID_STORE_PASSWORD,
28122
- HAI_ANDROID_KEY_ALIAS: process15.env.HAI_ANDROID_KEY_ALIAS,
28123
- HAI_ANDROID_KEY_PASSWORD: process15.env.HAI_ANDROID_KEY_PASSWORD
28091
+ HAI_ANDROID_STORE_PASSWORD: process14.env.HAI_ANDROID_STORE_PASSWORD,
28092
+ HAI_ANDROID_KEY_ALIAS: process14.env.HAI_ANDROID_KEY_ALIAS,
28093
+ HAI_ANDROID_KEY_PASSWORD: process14.env.HAI_ANDROID_KEY_PASSWORD
28124
28094
  };
28125
28095
  for (const [key, value] of Object.entries(values)) {
28126
28096
  if (!value)
28127
28097
  throw new Error(cliM("cli_build_android_signing"));
28128
28098
  signing[key] = value;
28129
28099
  }
28130
- const path10 = process15.env.HAI_ANDROID_KEYSTORE;
28100
+ const path10 = process14.env.HAI_ANDROID_KEYSTORE;
28131
28101
  if (!path10 || !existsSync(resolve(root, path10)) || !statSync(resolve(root, path10)).isFile())
28132
28102
  throw new Error(cliM("cli_build_android_signing"));
28133
28103
  keystore = resolve(root, path10);
@@ -28144,7 +28114,7 @@ async function buildContainerAndroid(root, apps, options, publish) {
28144
28114
  const proxyArgs = buildProxyArguments(downloads.proxy, runtime, network);
28145
28115
  const engineArgs = [
28146
28116
  ...network === void 0 ? [] : ["--network", network],
28147
- ...runtime === "docker" && process15.platform === "linux" && network !== "host" ? ["--add-host", "host.docker.internal:host-gateway"] : [],
28117
+ ...runtime === "docker" && process14.platform === "linux" && network !== "host" ? ["--add-host", "host.docker.internal:host-gateway"] : [],
28148
28118
  ...runtime === "podman" && downloads.proxy.mode === "none" ? ["--http-proxy=false"] : []
28149
28119
  ];
28150
28120
  try {
@@ -28195,8 +28165,8 @@ async function buildContainerAndroid(root, apps, options, publish) {
28195
28165
  argument.slice(equals + 1)
28196
28166
  ];
28197
28167
  }));
28198
- const uid = process15.getuid?.();
28199
- const gid = process15.getgid?.();
28168
+ const uid = process14.getuid?.();
28169
+ const gid = process14.getgid?.();
28200
28170
  const userArgs = uid === void 0 || gid === void 0 ? [] : [
28201
28171
  ...runtime === "podman" && uid !== 0 ? ["--userns=keep-id"] : [],
28202
28172
  "--user",
@@ -28289,7 +28259,7 @@ async function buildContainerAndroid(root, apps, options, publish) {
28289
28259
  }
28290
28260
  function gradleCommand(debug) {
28291
28261
  const task = debug ? "assembleDebug" : "assembleRelease";
28292
- return process15.platform === "win32" ? [
28262
+ return process14.platform === "win32" ? [
28293
28263
  "cmd.exe",
28294
28264
  "/d",
28295
28265
  "/c",
@@ -28310,7 +28280,7 @@ function isAppPackage(path10, platform, debug) {
28310
28280
  return parts.at(-2) === (debug ? "debug" : "release") && path10.endsWith(".apk") && !path10.endsWith("-unsigned.apk");
28311
28281
  }
28312
28282
  async function buildMobileApp(root, directories, platform, run2, debug = false, runGradle) {
28313
- if (!directories.length || platform === "ios" && process15.platform !== "darwin")
28283
+ if (!directories.length || platform === "ios" && process14.platform !== "darwin")
28314
28284
  throw new Error(cliM("cli_build_app_platform"));
28315
28285
  const outputs = [];
28316
28286
  for (const item of directories) {
@@ -28673,15 +28643,15 @@ async function forwardWindowsBuildOutput(source, destination) {
28673
28643
 
28674
28644
  // src/commands/cli-build.ts
28675
28645
  async function run(command, args, cwd, quiet = false, identity, compileEnvironment, progressOnStderr = false) {
28676
- await new Promise((resolve17, reject) => {
28677
- const env = Object.fromEntries(Object.entries(process15.env).filter(([key]) => !/^(?:HAI_|PUBLIC_|VITE_)/.test(key)));
28646
+ await new Promise((resolve15, reject) => {
28647
+ const env = Object.fromEntries(Object.entries(process14.env).filter(([key]) => !/^(?:HAI_|PUBLIC_|VITE_)/.test(key)));
28678
28648
  Object.assign(env, compileEnvironment);
28679
28649
  if (identity) {
28680
28650
  env.HAI_BUILD_ID = identity.buildId;
28681
28651
  env.HAI_BUILD_COMMIT = identity.commit;
28682
28652
  }
28683
28653
  env.NODE_ENV = "production";
28684
- if (process15.platform === "win32") {
28654
+ if (process14.platform === "win32") {
28685
28655
  env.npm_config_reporter = "append-only";
28686
28656
  env.pnpm_config_reporter = "append-only";
28687
28657
  }
@@ -28689,8 +28659,8 @@ async function run(command, args, cwd, quiet = false, identity, compileEnvironme
28689
28659
  if (env.CI === "1" || env.CI === "0") {
28690
28660
  env.CI = env.CI === "1" ? "true" : "false";
28691
28661
  }
28692
- const windowsOutput = !quiet && process15.platform === "win32";
28693
- const stdio = quiet ? "ignore" : windowsOutput ? ["inherit", "pipe", "pipe"] : progressOnStderr ? ["inherit", process15.stderr, "inherit"] : "inherit";
28662
+ const windowsOutput = !quiet && process14.platform === "win32";
28663
+ const stdio = quiet ? "ignore" : windowsOutput ? ["inherit", "pipe", "pipe"] : progressOnStderr ? ["inherit", process14.stderr, "inherit"] : "inherit";
28694
28664
  const child = spawn(command, args, {
28695
28665
  cwd,
28696
28666
  env,
@@ -28701,14 +28671,14 @@ async function run(command, args, cwd, quiet = false, identity, compileEnvironme
28701
28671
  let output2 = Promise.resolve();
28702
28672
  if (windowsOutput && child.stdout && child.stderr) {
28703
28673
  output2 = Promise.all([
28704
- forwardWindowsBuildOutput(child.stdout, progressOnStderr ? process15.stderr : process15.stdout),
28705
- forwardWindowsBuildOutput(child.stderr, process15.stderr)
28674
+ forwardWindowsBuildOutput(child.stdout, progressOnStderr ? process14.stderr : process14.stdout),
28675
+ forwardWindowsBuildOutput(child.stderr, process14.stderr)
28706
28676
  ]).then(() => void 0);
28707
28677
  void output2.catch(() => child.kill());
28708
28678
  }
28709
28679
  child.once("error", reject);
28710
28680
  child.once(windowsOutput && child.stdout && child.stderr ? "close" : "exit", (code) => {
28711
- void output2.then(() => code === 0 ? resolve17() : reject(new Error(cliM("cli_build_failed", {
28681
+ void output2.then(() => code === 0 ? resolve15() : reject(new Error(cliM("cli_build_failed", {
28712
28682
  params: {
28713
28683
  command,
28714
28684
  code: String(code)
@@ -28718,12 +28688,12 @@ async function run(command, args, cwd, quiet = false, identity, compileEnvironme
28718
28688
  });
28719
28689
  }
28720
28690
  async function pnpm(args, cwd, identity, compileEnvironment) {
28721
- const entry = process15.env.npm_execpath;
28691
+ const entry = process14.env.npm_execpath;
28722
28692
  if (entry && /(?:^|[/\\])pnpm(?:-native)?(?:\.exe|\.[cm]?js)?$/i.test(entry)) {
28723
- return /\.[cm]?js$/i.test(entry) ? run(process15.execPath, [entry, ...args], cwd, false, identity, compileEnvironment) : run(entry, args, cwd, false, identity, compileEnvironment);
28693
+ return /\.[cm]?js$/i.test(entry) ? run(process14.execPath, [entry, ...args], cwd, false, identity, compileEnvironment) : run(entry, args, cwd, false, identity, compileEnvironment);
28724
28694
  }
28725
- if (process15.platform === "win32") {
28726
- const directories = (process15.env.PATH ?? "").split(";");
28695
+ if (process14.platform === "win32") {
28696
+ const directories = (process14.env.PATH ?? "").split(";");
28727
28697
  for (const directory of directories) {
28728
28698
  const executable = join(directory, "pnpm.exe");
28729
28699
  if (existsSync(executable))
@@ -28731,7 +28701,7 @@ async function pnpm(args, cwd, identity, compileEnvironment) {
28731
28701
  for (const relative9 of ["node_modules/pnpm/bin/pnpm.cjs", "pnpm.cjs"]) {
28732
28702
  const candidate = join(directory, relative9);
28733
28703
  if (existsSync(candidate))
28734
- return run(process15.execPath, [candidate, ...args], cwd, false, identity, compileEnvironment);
28704
+ return run(process14.execPath, [candidate, ...args], cwd, false, identity, compileEnvironment);
28735
28705
  }
28736
28706
  }
28737
28707
  throw new Error(cliM("cli_build_use_pnpm"));
@@ -28739,8 +28709,8 @@ async function pnpm(args, cwd, identity, compileEnvironment) {
28739
28709
  return run("pnpm", args, cwd, false, identity, compileEnvironment);
28740
28710
  }
28741
28711
  function staticCompileEnvironment(target) {
28742
- const flag = process15.env.HAI_BUILD_STATIC;
28743
- const base = process15.env.PUBLIC_BASE_PATH;
28712
+ const flag = process14.env.HAI_BUILD_STATIC;
28713
+ const base = process14.env.PUBLIC_BASE_PATH;
28744
28714
  if (flag !== void 0 && flag !== "" && flag !== "0" && flag !== "1")
28745
28715
  throw new Error(cliM("cli_build_static_flag"));
28746
28716
  if (base && (!/^\/[\w.-]+(?:\/[\w.-]+)*$/.test(base) || base.split("/").some((segment) => segment === "." || segment === "..")))
@@ -28862,7 +28832,7 @@ async function buildRuntime(cwd, choice) {
28862
28832
  throw new Error(cliM("cli_build_runtime_missing"));
28863
28833
  }
28864
28834
  async function buildCommand(options) {
28865
- const directory = resolve(options.cwd ?? process15.cwd());
28835
+ const directory = resolve(options.cwd ?? process14.cwd());
28866
28836
  const target = options.target ?? "compile";
28867
28837
  const concurrency = Number(options.concurrency ?? 2);
28868
28838
  if (![1, 2].includes(concurrency))
@@ -28927,9 +28897,9 @@ async function buildCommand(options) {
28927
28897
  }
28928
28898
  if (target === "desktop") {
28929
28899
  const platforms = { win32: "windows", linux: "linux", darwin: "macos" };
28930
- const host = platforms[process15.platform];
28900
+ const host = platforms[process14.platform];
28931
28901
  const platform = options.platform ?? host;
28932
- const arch = options.arch ?? process15.arch;
28902
+ const arch = options.arch ?? process14.arch;
28933
28903
  if (!platform || platform !== host || !["x64", "arm64"].includes(arch))
28934
28904
  throw new Error(cliM("cli_build_native_host"));
28935
28905
  if (!config2.desktop?.length)
@@ -28940,7 +28910,7 @@ async function buildCommand(options) {
28940
28910
  const nativeEnvironment = nativeNameEnvironment(cwd);
28941
28911
  for (const item of config2.desktop) {
28942
28912
  const directory2 = nativeProjectDirectory(cwd, item);
28943
- const cargo = resolve(directory2, "src-tauri", process15.env.CARGO_TARGET_DIR || "target");
28913
+ const cargo = resolve(directory2, "src-tauri", process14.env.CARGO_TARGET_DIR || "target");
28944
28914
  const output2 = join(cargo, rustTarget, debug ? "debug" : "release", "bundle");
28945
28915
  const bundlesOnDisk = () => nativeFiles(output2, (path10, isDirectory) => isDirectory ? platform === "macos" && path10.endsWith(".app") : platform === "windows" ? path10.endsWith(".exe") : platform === "macos" ? path10.endsWith(".dmg") : /\.(?:deb|AppImage)$/.test(path10));
28946
28916
  const before = bundlesOnDisk();
@@ -28980,7 +28950,7 @@ async function buildCommand(options) {
28980
28950
  if (selected && (selected.some((name) => !config2.images.some((image) => image.name === name)) || new Set(selected).size !== selected.length))
28981
28951
  throw new Error(cliM("cli_build_selection_invalid"));
28982
28952
  const images = config2.images.filter((image) => !selected || selected.includes(image.name));
28983
- const webBasePath = compileEnvironment.PUBLIC_BASE_PATH;
28953
+ const webBasePath = compileEnvironment.PUBLIC_BASE_PATH ?? "";
28984
28954
  if (webBasePath && !config2.images.some((image) => image.name === "web"))
28985
28955
  throw new Error(cliM("cli_build_base_requires_web"));
28986
28956
  for (const image of images) {
@@ -28996,7 +28966,8 @@ async function buildCommand(options) {
28996
28966
  resolve(cwd, image.dockerfile)
28997
28967
  ]);
28998
28968
  const artifact = {
28999
- version: 4,
28969
+ version: 5,
28970
+ webBasePath,
29000
28971
  primaryService: config2.images.some((image) => image.name === "serv") ? "serv" : "web",
29001
28972
  appVersion,
29002
28973
  buildId,
@@ -29011,12 +28982,8 @@ async function buildCommand(options) {
29011
28982
  const downloads = await resolveBuildDownloads(cwd, options.json ? { ...options, yes: true } : options);
29012
28983
  for (const image of images) validateDownloadDockerfile(resolve(cwd, image.dockerfile), downloads);
29013
28984
  const runtime = await buildRuntime(cwd, options.runtime);
29014
- await preflightDownloadProxy(runtime, downloads.proxy, options.json ? (message) => process15.stderr.write(`${message}
28985
+ await preflightDownloadProxy(runtime, downloads.proxy, options.json ? (message) => process14.stderr.write(`${message}
29015
28986
  `) : void 0);
29016
- if (webBasePath) {
29017
- artifact.version = 5;
29018
- artifact.webBasePath = webBasePath;
29019
- }
29020
28987
  for (const image of config2.images) {
29021
28988
  if (image.containerPort !== void 0) {
29022
28989
  artifact[image.name === "serv" ? "servContainerPort" : "webContainerPort"] = image.containerPort;
@@ -29042,8 +29009,8 @@ async function buildCommand(options) {
29042
29009
  "-t",
29043
29010
  imageRef
29044
29011
  ];
29045
- const testRun = process15.env.HAI_TEST_IMAGE_RUN;
29046
- const testLedger = process15.env.HAI_TEST_IMAGE_LEDGER;
29012
+ const testRun = process14.env.HAI_TEST_IMAGE_RUN;
29013
+ const testLedger = process14.env.HAI_TEST_IMAGE_LEDGER;
29047
29014
  if (testLedger && /^[a-f0-9-]{36}$/.test(testRun ?? "")) {
29048
29015
  const label = `org.h-ai.test.image-run=${testRun}`;
29049
29016
  args.push("--label", label);
@@ -29057,7 +29024,7 @@ async function buildCommand(options) {
29057
29024
  for (const match of dockerfile.matchAll(/^ARG (HAI_(?:NODE|NGINX)_IMAGE)=(\S+)\s*$/gm))
29058
29025
  args.push("--build-arg", `${match[1]}=${resolveImageReference(match[2], downloads.imageSource)}`);
29059
29026
  args.push("--build-arg", `HAI_NPM_REGISTRY=${downloads.npmRegistry}`, ...buildProxyArguments(downloads.proxy, runtime, options.network));
29060
- if (runtime === "docker" && process15.platform === "linux" && options.network !== "host")
29027
+ if (runtime === "docker" && process14.platform === "linux" && options.network !== "host")
29061
29028
  args.push("--add-host", "host.docker.internal:host-gateway");
29062
29029
  if (options.network !== void 0)
29063
29030
  args.push("--network", options.network);
@@ -29109,7 +29076,7 @@ async function buildCommand(options) {
29109
29076
  `);
29110
29077
  renameSync(join(parent, `latest-${buildId}`), join(parent, "latest"));
29111
29078
  if (options.json) {
29112
- process15.stdout.write(`${JSON.stringify({
29079
+ process14.stdout.write(`${JSON.stringify({
29113
29080
  schemaVersion: 1,
29114
29081
  artifactDir: output2,
29115
29082
  manifestPath: join(output2, "manifest.json"),
@@ -29133,30 +29100,6 @@ async function buildCommand(options) {
29133
29100
  rmSync(staging, { recursive: true, force: true });
29134
29101
  }
29135
29102
  }
29136
- async function deploySecretsCommand(directory, options) {
29137
- if (!options.import || !["docker", "podman"].includes(options.runtime ?? "docker"))
29138
- throw new Error(cliM("cli_deploy_secrets_options"));
29139
- const cwd = resolve(options.cwd ?? process15.cwd());
29140
- const local = createRequire(resolve(cwd, "package.json"));
29141
- let module;
29142
- try {
29143
- module = await import(pathToFileURL(local.resolve("@h-ai/deploy")).href);
29144
- } catch {
29145
- throw new Error(cliM("cli_deploy_module_missing"));
29146
- }
29147
- const result = await module.importDeploymentSecrets({
29148
- directory: resolve(cwd, directory),
29149
- inputFile: resolve(cwd, options.import),
29150
- runtime: options.runtime === "podman" ? "podman" : "docker",
29151
- dryRun: options.apply !== true
29152
- });
29153
- if (!result.success) {
29154
- const context = result.error.ext;
29155
- throw new Error(`${result.error.message}
29156
- ${JSON.stringify({ phase: context?.phase, state: context?.state })}`);
29157
- }
29158
- writeCliMessage(JSON.stringify(result.data, null, 2));
29159
- }
29160
29103
  var s3FieldPrompts = {
29161
29104
  endpoint: "cli_deploy_s3_endpoint",
29162
29105
  bucket: "cli_deploy_s3_bucket",
@@ -29741,13 +29684,16 @@ async function configureDeployHttps(module, config2, environment, nonInteractive
29741
29684
  }
29742
29685
  async function deployCommand(options) {
29743
29686
  const spinner = ora();
29744
- const cwd = options.cwd ?? process15.cwd();
29687
+ const cwd = options.cwd ?? process14.cwd();
29745
29688
  let appDir = resolve(cwd, options.appDir ?? ".");
29746
29689
  let closeDeploy = null;
29747
29690
  let restoreProjectLogger;
29748
- const originalEnv = { ...process15.env };
29691
+ let configureProjectLogger;
29692
+ const originalEnv = { ...process14.env };
29749
29693
  const previousLogLevel = core.logger.getLevel();
29750
- core.logger.setLevel("fatal");
29694
+ const initialLevel = options.plan ? "fatal" : LogLevelSchema.safeParse(process14.env.HAI_CORE_LOGGING_LEVEL).data;
29695
+ if (initialLevel)
29696
+ core.logger.setLevel(initialLevel);
29751
29697
  try {
29752
29698
  if (options.inspectRemote && !options.plan)
29753
29699
  throw new Error(cliM("cli_deploy_plan_options"));
@@ -29762,7 +29708,7 @@ async function deployCommand(options) {
29762
29708
  throw new Error(cliM("cli_build_selection_invalid"));
29763
29709
  let environmentName = options.env;
29764
29710
  if (!environmentName) {
29765
- if (!process15.stdin.isTTY)
29711
+ if (!process14.stdin.isTTY)
29766
29712
  throw new Error(cliM("cli_deploy_environment_hint"));
29767
29713
  const answer = await prompts({
29768
29714
  type: "text",
@@ -29774,7 +29720,7 @@ async function deployCommand(options) {
29774
29720
  if (!environmentName)
29775
29721
  throw new Error(cliM("cli_deploy_cancelled"));
29776
29722
  }
29777
- if (!options.plan && !options.yes && !process15.stdin.isTTY)
29723
+ if (!options.plan && !options.yes && !process14.stdin.isTTY)
29778
29724
  throw new Error(cliM("cli_deploy_environment_hint"));
29779
29725
  let deployModule;
29780
29726
  try {
@@ -29782,9 +29728,11 @@ async function deployCommand(options) {
29782
29728
  try {
29783
29729
  const { core: projectCore } = await import(pathToFileURL(localRequire.resolve("@h-ai/core")).href);
29784
29730
  if (projectCore !== core) {
29785
- const level = projectCore.logger.getLevel();
29786
- projectCore.logger.setLevel("fatal");
29787
- restoreProjectLogger = () => projectCore.logger.setLevel(level);
29731
+ const level2 = projectCore.logger.getLevel();
29732
+ configureProjectLogger = (next) => projectCore.logger.setLevel(next);
29733
+ if (initialLevel)
29734
+ configureProjectLogger(initialLevel);
29735
+ restoreProjectLogger = () => projectCore.logger.setLevel(level2);
29788
29736
  }
29789
29737
  } catch {
29790
29738
  }
@@ -29848,7 +29796,7 @@ async function deployCommand(options) {
29848
29796
  if (options.build || options.bundleOnly || options.output || options.imageSource !== void 0 || options.imageMirrors !== void 0 || options.npmSource !== void 0 || options.npmRegistry !== void 0 || options.proxyMode !== void 0 || options.proxyUrl !== void 0 || options.proxyBypass !== void 0 || options.httpProxy === false)
29849
29797
  throw new Error(cliM("cli_deploy_plan_options"));
29850
29798
  const loaded = deployModule.loadDeploymentConfig("deploy", buildFile, {
29851
- ...process15.env,
29799
+ ...process14.env,
29852
29800
  ...environment.data.values
29853
29801
  });
29854
29802
  if (!loaded.success)
@@ -29876,7 +29824,12 @@ async function deployCommand(options) {
29876
29824
  writeCliMessage(JSON.stringify(plan.data, null, 2));
29877
29825
  return;
29878
29826
  }
29879
- Object.assign(process15.env, environment.data.values);
29827
+ Object.assign(process14.env, environment.data.values);
29828
+ const level = LogLevelSchema.safeParse(process14.env.HAI_CORE_LOGGING_LEVEL);
29829
+ if (level.success) {
29830
+ core.logger.setLevel(level.data);
29831
+ configureProjectLogger?.(level.data);
29832
+ }
29880
29833
  spinner.start(cliM("cli_deploy_load_credentials"));
29881
29834
  const credResult = deploy.credentials.load();
29882
29835
  if (!credResult.success) {
@@ -29898,7 +29851,7 @@ async function deployCommand(options) {
29898
29851
  params: { path: configPath }
29899
29852
  }));
29900
29853
  }
29901
- const loadedConfig = deployModule.loadDeploymentConfig("deploy", configPath, process15.env);
29854
+ const loadedConfig = deployModule.loadDeploymentConfig("deploy", configPath, process14.env);
29902
29855
  if (!loadedConfig.success)
29903
29856
  throw new Error(loadedConfig.error.message);
29904
29857
  const deployConfig = loadedConfig.data;
@@ -30031,15 +29984,15 @@ async function deployCommand(options) {
30031
29984
  if (options.bundleOnly)
30032
29985
  await configureDeployTarget(deployModule, deployConfig, environment.data, options.yes, true);
30033
29986
  await configureDeployHttps(deployModule, deployConfig, environment.data, options.yes, selectedServices !== void 0);
30034
- for (const key of Object.keys(process15.env)) {
29987
+ for (const key of Object.keys(process14.env)) {
30035
29988
  if (originalEnv[key] === void 0)
30036
- delete process15.env[key];
29989
+ delete process14.env[key];
30037
29990
  }
30038
- Object.assign(process15.env, originalEnv);
29991
+ Object.assign(process14.env, originalEnv);
30039
29992
  const refreshed = deployModule.loadDeploymentEnvironment({ environment: environment.data.environment, envDir: environment.data.envDir });
30040
29993
  if (!refreshed.success)
30041
29994
  throw new Error(refreshed.error.message);
30042
- Object.assign(process15.env, refreshed.data.values);
29995
+ Object.assign(process14.env, refreshed.data.values);
30043
29996
  spinner.start(cliM("cli_deploy_initializing"));
30044
29997
  const validatedConfig = deployModule.DeployConfigSchema.safeParse(deployConfig);
30045
29998
  if (!validatedConfig.success) {
@@ -30147,14 +30100,14 @@ async function deployCommand(options) {
30147
30100
  await closeDeploy();
30148
30101
  } catch (error62) {
30149
30102
  writeCliError("Failed to close deploy module", error62);
30150
- process15.exitCode = 1;
30103
+ process14.exitCode = 1;
30151
30104
  }
30152
30105
  }
30153
- for (const key of Object.keys(process15.env)) {
30106
+ for (const key of Object.keys(process14.env)) {
30154
30107
  if (originalEnv[key] === void 0)
30155
- delete process15.env[key];
30108
+ delete process14.env[key];
30156
30109
  }
30157
- Object.assign(process15.env, originalEnv);
30110
+ Object.assign(process14.env, originalEnv);
30158
30111
  core.logger.setLevel(previousLogLevel);
30159
30112
  restoreProjectLogger?.();
30160
30113
  }
@@ -30362,11 +30315,11 @@ var ec = [
30362
30315
  "invalid zip data"
30363
30316
  // determined by unknown compression method
30364
30317
  ];
30365
- var err29 = function(ind, msg, nt) {
30318
+ var err28 = function(ind, msg, nt) {
30366
30319
  var e = new Error(msg || ec[ind]);
30367
30320
  e.code = ind;
30368
30321
  if (Error.captureStackTrace)
30369
- Error.captureStackTrace(e, err29);
30322
+ Error.captureStackTrace(e, err28);
30370
30323
  if (!nt)
30371
30324
  throw e;
30372
30325
  return e;
@@ -30399,7 +30352,7 @@ var inflt = function(dat, st, buf, dict) {
30399
30352
  var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;
30400
30353
  if (t > sl) {
30401
30354
  if (noSt)
30402
- err29(0);
30355
+ err28(0);
30403
30356
  break;
30404
30357
  }
30405
30358
  if (resize)
@@ -30445,10 +30398,10 @@ var inflt = function(dat, st, buf, dict) {
30445
30398
  lm = hMap(lt, lbt);
30446
30399
  dm = hMap(dt, dbt);
30447
30400
  } else
30448
- err29(1);
30401
+ err28(1);
30449
30402
  if (pos > tbts) {
30450
30403
  if (noSt)
30451
- err29(0);
30404
+ err28(0);
30452
30405
  break;
30453
30406
  }
30454
30407
  }
@@ -30461,11 +30414,11 @@ var inflt = function(dat, st, buf, dict) {
30461
30414
  pos += c & 15;
30462
30415
  if (pos > tbts) {
30463
30416
  if (noSt)
30464
- err29(0);
30417
+ err28(0);
30465
30418
  break;
30466
30419
  }
30467
30420
  if (!c)
30468
- err29(2);
30421
+ err28(2);
30469
30422
  if (sym < 256)
30470
30423
  buf[bt++] = sym;
30471
30424
  else if (sym == 256) {
@@ -30480,7 +30433,7 @@ var inflt = function(dat, st, buf, dict) {
30480
30433
  }
30481
30434
  var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
30482
30435
  if (!d)
30483
- err29(3);
30436
+ err28(3);
30484
30437
  pos += d & 15;
30485
30438
  var dt = fd[dsym];
30486
30439
  if (dsym > 3) {
@@ -30489,7 +30442,7 @@ var inflt = function(dat, st, buf, dict) {
30489
30442
  }
30490
30443
  if (pos > tbts) {
30491
30444
  if (noSt)
30492
- err29(0);
30445
+ err28(0);
30493
30446
  break;
30494
30447
  }
30495
30448
  if (resize)
@@ -30498,7 +30451,7 @@ var inflt = function(dat, st, buf, dict) {
30498
30451
  if (bt < dt) {
30499
30452
  var shift = dl - dt, dend = Math.min(dt, end);
30500
30453
  if (shift + bt < 0)
30501
- err29(3);
30454
+ err28(3);
30502
30455
  for (; bt < dend; ++bt)
30503
30456
  buf[bt] = dict[shift + bt];
30504
30457
  }
@@ -30588,7 +30541,7 @@ function strFromU8(dat, latin1) {
30588
30541
  } else {
30589
30542
  var _a4 = dutf8(dat), s = _a4.s, r = _a4.r;
30590
30543
  if (r.length)
30591
- err29(8);
30544
+ err28(8);
30592
30545
  return s;
30593
30546
  }
30594
30547
  }
@@ -30615,7 +30568,7 @@ var z64hs = function(d, b, l, z2, sc, su, off) {
30615
30568
  }
30616
30569
  }
30617
30570
  if (z2 < 2)
30618
- err29(13);
30571
+ err28(13);
30619
30572
  }
30620
30573
  return [sc, su, off, 0];
30621
30574
  };
@@ -30624,7 +30577,7 @@ function unzipSync(data, opts) {
30624
30577
  var e = data.length - 22;
30625
30578
  for (; b4(data, e) != 101010256; --e) {
30626
30579
  if (!e || data.length - e > 65558)
30627
- err29(13);
30580
+ err28(13);
30628
30581
  }
30629
30582
  var c = b2(data, e + 8);
30630
30583
  if (!c)
@@ -30648,7 +30601,7 @@ function unzipSync(data, opts) {
30648
30601
  else if (c_2 == 8)
30649
30602
  files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });
30650
30603
  else
30651
- err29(14, "unknown compression type " + c_2);
30604
+ err28(14, "unknown compression type " + c_2);
30652
30605
  }
30653
30606
  }
30654
30607
  return files;
@@ -31039,11 +30992,11 @@ async function startFeedbackViewer(bundle, options = {}) {
31039
30992
  response.setHeader("Content-Disposition", "attachment");
31040
30993
  response.writeHead(200).end(bytes);
31041
30994
  });
31042
- await new Promise((resolve17, reject) => {
30995
+ await new Promise((resolve15, reject) => {
31043
30996
  server.once("error", reject);
31044
30997
  server.listen(port, "127.0.0.1", () => {
31045
30998
  server.removeListener("error", reject);
31046
- resolve17();
30999
+ resolve15();
31047
31000
  });
31048
31001
  });
31049
31002
  const address = server.address();
@@ -31051,8 +31004,8 @@ async function startFeedbackViewer(bundle, options = {}) {
31051
31004
  throw new Error(cliM("cli_feedback_invalidOptions"));
31052
31005
  return {
31053
31006
  url: `http://127.0.0.1:${address.port}${prefix}viewer/index.html`,
31054
- close: () => new Promise((resolve17, reject) => {
31055
- server.close((error62) => error62 ? reject(error62) : resolve17());
31007
+ close: () => new Promise((resolve15, reject) => {
31008
+ server.close((error62) => error62 ? reject(error62) : resolve15());
31056
31009
  server.closeAllConnections();
31057
31010
  })
31058
31011
  };
@@ -31098,7 +31051,7 @@ async function feedbackCommand(action, bundlePath, options = {}) {
31098
31051
  ].includes(action)) {
31099
31052
  throw new Error(cliM("cli_feedback_invalidAction"));
31100
31053
  }
31101
- const filePath = path2.resolve(options.cwd ?? process15.cwd(), bundlePath);
31054
+ const filePath = path2.resolve(options.cwd ?? process14.cwd(), bundlePath);
31102
31055
  const result = await readFeedbackBundle(readBundleFile(filePath));
31103
31056
  if (!result.success)
31104
31057
  throw new Error(result.error.message);
@@ -31129,14 +31082,14 @@ async function feedbackCommand(action, bundlePath, options = {}) {
31129
31082
  writeCliMessage(cliM("cli_feedback_viewerStarted", {
31130
31083
  params: { url: viewer.url }
31131
31084
  }));
31132
- await new Promise((resolve17, reject) => {
31085
+ await new Promise((resolve15, reject) => {
31133
31086
  const stop = () => {
31134
- process15.off("SIGINT", stop);
31135
- process15.off("SIGTERM", stop);
31136
- viewer.close().then(resolve17, reject);
31087
+ process14.off("SIGINT", stop);
31088
+ process14.off("SIGTERM", stop);
31089
+ viewer.close().then(resolve15, reject);
31137
31090
  };
31138
- process15.once("SIGINT", stop);
31139
- process15.once("SIGTERM", stop);
31091
+ process14.once("SIGINT", stop);
31092
+ process14.once("SIGTERM", stop);
31140
31093
  });
31141
31094
  }
31142
31095
  function appendAt(source, marker, entry) {
@@ -31863,7 +31816,7 @@ async function initProject(options) {
31863
31816
  }
31864
31817
  }));
31865
31818
  if (project.isHaiProject) {
31866
- const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-D6S2OQ6X.js');
31819
+ const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-JKF6E3PI.js');
31867
31820
  const generatedFiles = await generateProjectAiSupport(cwd, resolveSkillNamesForPackages(project.haiPackages), {
31868
31821
  overwriteSkills: false,
31869
31822
  overwriteBridgeFiles: false
@@ -31958,17 +31911,6 @@ async function initProject(options) {
31958
31911
  function object3(value) {
31959
31912
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
31960
31913
  }
31961
- function declaresValueExport(source, name) {
31962
- const declarations = source.replace(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`/g, " ");
31963
- if (new RegExp(`\\bexport\\s+(?:declare\\s+)?(?:function|const|let|var)\\s+${name}\\b`).test(declarations))
31964
- return true;
31965
- return [
31966
- ...declarations.matchAll(/\bexport\s*\{([^}]+)\}/g)
31967
- ].some((match) => match[1].split(",").some((item) => {
31968
- const value = item.trim();
31969
- return !value.startsWith("type ") && value.split(/\s+as\s+/).at(-1)?.trim() === name;
31970
- }));
31971
- }
31972
31914
  function tarFiles(bytes) {
31973
31915
  const tar = gunzipSync(bytes, { maxOutputLength: 64 * 1024 * 1024 });
31974
31916
  const files = /* @__PURE__ */ new Map();
@@ -32003,7 +31945,7 @@ async function inspectFrameworkUpgrade(directory, version2) {
32003
31945
  for await (const manifest of glob(`${pattern}/package.json`, { cwd: root, exclude })) {
32004
31946
  const location = realpathSync(dirname(join(root, manifest)));
32005
31947
  const fromRoot = relative(root, location);
32006
- if (!isAbsolute(fromRoot) && fromRoot !== ".." && !fromRoot.startsWith(`..${process15.platform === "win32" ? "\\" : "/"}`)) {
31948
+ if (!isAbsolute(fromRoot) && fromRoot !== ".." && !fromRoot.startsWith(`..${process14.platform === "win32" ? "\\" : "/"}`)) {
32007
31949
  directories.add(location);
32008
31950
  }
32009
31951
  }
@@ -32065,11 +32007,10 @@ async function inspectFrameworkUpgrade(directory, version2) {
32065
32007
  });
32066
32008
  }
32067
32009
  }
32068
- const registry2 = new URL(process15.env.npm_config_registry ?? "https://registry.npmjs.org/");
32010
+ const registry2 = new URL(process14.env.npm_config_registry ?? "https://registry.npmjs.org/");
32069
32011
  if (registry2.username || registry2.password || registry2.protocol !== "https:")
32070
32012
  throw new Error(cliM("cli_upgrade_registry"));
32071
32013
  const releases = [];
32072
- const migrationPreflight = [];
32073
32014
  const skills = [];
32074
32015
  const pending = [...packages];
32075
32016
  for (let index = 0; index < pending.length; index++) {
@@ -32124,14 +32065,6 @@ async function inspectFrameworkUpgrade(directory, version2) {
32124
32065
  const manifest = files.get("package/package.json");
32125
32066
  if (!manifest || object3(JSON.parse(new TextDecoder().decode(manifest))).version !== version2 || !files.has("package/dist/index.js"))
32126
32067
  throw new Error("Incomplete artifact");
32127
- const migration = {
32128
- "@h-ai/iam": "migrateIam",
32129
- "@h-ai/reach": "migrateReach",
32130
- "@h-ai/scheduler": "migrateScheduler",
32131
- "@h-ai/audit": "migrateAudit"
32132
- }[name];
32133
- if (migration && declaresValueExport(new TextDecoder().decode(files.get("package/dist/index.d.ts")), migration) && declaresValueExport(new TextDecoder().decode(files.get("package/dist/index.js")), migration))
32134
- migrationPreflight.push(`${migration}({ dryRun: true })`);
32135
32068
  if (name === "@h-ai/cli") {
32136
32069
  if (!files.has("package/templates/skills/hai-feedback/SKILL.md"))
32137
32070
  throw new Error("Skills missing");
@@ -32184,22 +32117,14 @@ async function inspectFrameworkUpgrade(directory, version2) {
32184
32117
  ...Object.keys(object3(object3(rootManifest.pnpm).patchedDependencies))
32185
32118
  ])
32186
32119
  ]
32187
- },
32188
- migration: {
32189
- preflight: migrationPreflight,
32190
- inspectModuleReadmes: true,
32191
- exclusiveAccess: true,
32192
- backup: ["database", "shared-session-cache"],
32193
- rollback: "restore-compatible-database-and-binaries",
32194
- sessions: "legacy-credential-sessions-require-login"
32195
32120
  }
32196
32121
  };
32197
32122
  }
32198
32123
  async function upgradeCommand(version2, options = {}) {
32199
- const report = await inspectFrameworkUpgrade(options.cwd ?? process15.cwd(), version2);
32124
+ const report = await inspectFrameworkUpgrade(options.cwd ?? process14.cwd(), version2);
32200
32125
  writeCliMessage(JSON.stringify(report, null, 2));
32201
32126
  if (!report.releaseComplete)
32202
- process15.exitCode = 1;
32127
+ process14.exitCode = 1;
32203
32128
  }
32204
32129
 
32205
32130
  // src/cli-main.ts
@@ -32224,7 +32149,7 @@ cli.command("create [name]", cliM("cli_help_create")).option("--type <type>", cl
32224
32149
  cwd: options.cwd
32225
32150
  });
32226
32151
  } catch {
32227
- process15.exitCode = 1;
32152
+ process14.exitCode = 1;
32228
32153
  }
32229
32154
  });
32230
32155
  cli.command("add [module]", cliM("cli_help_add")).option("--no-install", cliM("cli_help_noInstall")).action(async (module, options) => {
@@ -32236,7 +32161,7 @@ cli.command("add [module]", cliM("cli_help_add")).option("--no-install", cliM("c
32236
32161
  cwd: options.cwd
32237
32162
  });
32238
32163
  } catch {
32239
- process15.exit(1);
32164
+ process14.exit(1);
32240
32165
  }
32241
32166
  });
32242
32167
  cli.command("init", cliM("cli_help_init")).option("-f, --force", cliM("cli_help_forceConfig")).action(async (options) => {
@@ -32247,7 +32172,7 @@ cli.command("init", cliM("cli_help_init")).option("-f, --force", cliM("cli_help_
32247
32172
  cwd: options.cwd
32248
32173
  });
32249
32174
  } catch {
32250
- process15.exit(1);
32175
+ process14.exit(1);
32251
32176
  }
32252
32177
  });
32253
32178
  cli.command("generate [type] [name]", cliM("cli_help_generate")).option("-w, --workspace <name>", cliM("cli_help_workspace")).alias("g").option("-o, --output <path>", cliM("cli_help_output")).option("-f, --force", cliM("cli_help_force")).action(async (type, name, options) => {
@@ -32264,7 +32189,7 @@ cli.command("generate [type] [name]", cliM("cli_help_generate")).option("-w, --w
32264
32189
  cwd: options.cwd
32265
32190
  });
32266
32191
  } catch {
32267
- process15.exit(1);
32192
+ process14.exit(1);
32268
32193
  }
32269
32194
  });
32270
32195
  cli.command("build", cliM("cli_help_build")).option("--target <target>", cliM("cli_help_target")).option("--json", cliM("cli_help_buildJson")).option("--images <names>", cliM("cli_help_images")).option("--concurrency <count>", cliM("cli_help_buildConcurrency")).option("--runtime <runtime>", cliM("cli_help_buildRuntime")).option("--network <network>", cliM("cli_help_buildNetwork")).option("--platform <platform>", cliM("cli_help_platform")).option("--arch <arch>", cliM("cli_help_arch")).option("--debug", cliM("cli_help_buildDebug")).option("--no-http-proxy", cliM("cli_help_noHttpProxy")).option("-y, --yes", cliM("cli_help_deployYes")).option("--image-source <source>", cliM("cli_help_imageSource")).option("--image-mirrors <mappings>", cliM("cli_help_imageMirrors")).option("--npm-source <source>", cliM("cli_help_npmSource")).option("--npm-registry <url>", cliM("cli_help_npmRegistry")).option("--proxy-mode <mode>", cliM("cli_help_proxyMode")).option("--proxy-url <url>", cliM("cli_help_proxyUrl")).option("--proxy-bypass <hosts>", cliM("cli_help_proxyBypass")).action(async (options) => {
@@ -32276,7 +32201,7 @@ cli.command("build", cliM("cli_help_build")).option("--target <target>", cliM("c
32276
32201
  writeCliError(message);
32277
32202
  else
32278
32203
  writeCliMessage(message);
32279
- process15.exitCode = 1;
32204
+ process14.exitCode = 1;
32280
32205
  }
32281
32206
  });
32282
32207
  cli.command("upgrade <version>", cliM("cli_help_upgrade")).action(async (version2, options) => {
@@ -32284,7 +32209,7 @@ cli.command("upgrade <version>", cliM("cli_help_upgrade")).action(async (version
32284
32209
  await upgradeCommand(version2, options);
32285
32210
  } catch (error62) {
32286
32211
  writeCliMessage(error62 instanceof Error ? error62.message : String(error62));
32287
- process15.exitCode = 1;
32212
+ process14.exitCode = 1;
32288
32213
  }
32289
32214
  });
32290
32215
  cli.command("deploy [appDir]", cliM("cli_help_deploy")).option("--plan", cliM("cli_help_deployPlan")).option("--inspect-remote", cliM("cli_help_inspectRemote")).option("--env <environment>", cliM("cli_help_environment")).option("--env-dir <path>", cliM("cli_help_envDir")).option("-y, --yes", cliM("cli_help_deployYes")).option("--skip-middleware", cliM("cli_help_skipMiddleware")).option("--artifact-dir <path>", cliM("cli_help_artifactDir")).option("--services <names>", cliM("cli_help_services")).option("--build", cliM("cli_help_deployBuild")).option("--concurrency <count>", cliM("cli_help_buildConcurrency")).option("--network <network>", cliM("cli_help_deployNetwork")).option("--no-http-proxy", cliM("cli_help_deployNoProxy")).option("--image-source <source>", cliM("cli_help_imageSource")).option("--image-mirrors <mappings>", cliM("cli_help_imageMirrors")).option("--npm-source <source>", cliM("cli_help_npmSource")).option("--npm-registry <url>", cliM("cli_help_npmRegistry")).option("--proxy-mode <mode>", cliM("cli_help_proxyMode")).option("--proxy-url <url>", cliM("cli_help_proxyUrl")).option("--proxy-bypass <hosts>", cliM("cli_help_proxyBypass")).option("--runtime <runtime>", cliM("cli_help_deployRuntime")).option("--bundle-only", cliM("cli_help_bundleOnly")).option("--output <path>", cliM("cli_help_bundleOutput")).action(async (appDir, options) => {
@@ -32317,15 +32242,7 @@ cli.command("deploy [appDir]", cliM("cli_help_deploy")).option("--plan", cliM("c
32317
32242
  cwd: options.cwd
32318
32243
  });
32319
32244
  } catch {
32320
- process15.exitCode = 1;
32321
- }
32322
- });
32323
- cli.command("deploy-secrets <directory>", cliM("cli_help_deploySecrets")).option("--import <file>", cliM("cli_help_secretImport")).option("--apply", cliM("cli_help_secretApply")).option("--runtime <runtime>", cliM("cli_help_deployRuntime")).action(async (directory, options) => {
32324
- try {
32325
- await deploySecretsCommand(directory, options);
32326
- } catch (error62) {
32327
- writeCliMessage(error62 instanceof Error ? error62.message : String(error62));
32328
- process15.exitCode = 1;
32245
+ process14.exitCode = 1;
32329
32246
  }
32330
32247
  });
32331
32248
  cli.command("feedback <action> <bundle>", cliM("cli_help_feedback")).option("--page <number>", cliM("cli_feedback_page")).option("--page-size <number>", cliM("cli_feedback_pageSize")).option("--kind <kind>", cliM("cli_feedback_kind")).option("--request-id <id>", cliM("cli_feedback_requestId")).option("--error-id <id>", cliM("cli_feedback_errorId")).option("--from <timestamp>", cliM("cli_feedback_from")).option("--to <timestamp>", cliM("cli_feedback_to")).option("--port <number>", cliM("cli_feedback_port")).action(async (action, bundle, options) => {
@@ -32344,7 +32261,7 @@ cli.command("feedback <action> <bundle>", cliM("cli_help_feedback")).option("--p
32344
32261
  });
32345
32262
  } catch (error62) {
32346
32263
  writeCliMessage(error62 instanceof Error ? error62.message : String(error62));
32347
- process15.exitCode = 1;
32264
+ process14.exitCode = 1;
32348
32265
  }
32349
32266
  });
32350
32267
  cli.command("g:page <name>", cliM("cli_help_generatePage")).option("-w, --workspace <name>", cliM("cli_help_workspace")).action(async (name, options) => {