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

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 (34) hide show
  1. package/README.en.md +2 -0
  2. package/README.ja.md +2 -0
  3. package/README.md +2 -0
  4. package/dist/{chunk-L53P43B2.js → chunk-EFC6IHNF.js} +38 -18
  5. package/dist/chunk-EFC6IHNF.js.map +1 -0
  6. package/dist/cli-config-templates-JJD7YXKL.js +5 -0
  7. package/dist/{cli-config-templates-LWMD2I6V.js.map → cli-config-templates-JJD7YXKL.js.map} +1 -1
  8. package/dist/index.js +27 -10
  9. package/dist/index.js.map +1 -1
  10. package/dist/metafile-esm.json +1 -1
  11. package/package.json +14 -14
  12. package/templates/apps/fullstack/images/web/nginx.conf.hbs +3 -1
  13. package/templates/base/images/web/nginx.conf.hbs +3 -1
  14. package/templates/base/package.json.hbs +1 -1
  15. package/templates/shared/download-error/http.conf +19 -0
  16. package/templates/shared/download-error/server.conf +52 -0
  17. package/templates/skills/hai-api-client/SKILL.md +1 -1
  18. package/templates/skills/hai-app-create/SKILL.md +2 -0
  19. package/templates/skills/hai-app-create/logging.md +32 -0
  20. package/templates/skills/hai-app-create/project.md +1 -0
  21. package/templates/skills/hai-app-create/reference.md +2 -4
  22. package/templates/skills/hai-app-review/SKILL.md +1 -1
  23. package/templates/skills/hai-core/reference.md +2 -11
  24. package/templates/skills/hai-crypto/reference.md +2 -2
  25. package/templates/skills/hai-deploy/SKILL.md +2 -0
  26. package/templates/skills/hai-kit/SKILL.md +2 -2
  27. package/templates/skills/hai-kit/reference.md +1 -1
  28. package/templates/skills/hai-reldb/reference.md +1 -1
  29. package/templates/skills/hai-serv/SKILL.md +1 -1
  30. package/templates/skills/hai-storage/SKILL.md +1 -0
  31. package/templates/skills/hai-storage/reference.md +13 -3
  32. package/templates/skills/hai-vecdb/reference.md +1 -1
  33. package/dist/chunk-L53P43B2.js.map +0 -1
  34. package/dist/cli-config-templates-LWMD2I6V.js +0 -5
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ export { generateConfigFile, generateEnvExample, generateProductionEnvironment } from './chunk-EFC6IHNF.js';
3
+ import './chunk-ZSDEVXZ7.js';
4
+ //# sourceMappingURL=cli-config-templates-JJD7YXKL.js.map
5
+ //# sourceMappingURL=cli-config-templates-JJD7YXKL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"cli-config-templates-LWMD2I6V.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"cli-config-templates-JJD7YXKL.js"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { generateConfigFile, runtimeEnvironmentVariables, renderEnvironment, generateProductionEnvironment, moduleEnvironmentVariables, documentConfig, parameterizeConfig } from './chunk-L53P43B2.js';
2
+ import { generateConfigFile, runtimeEnvironmentVariables, renderEnvironment, generateProductionEnvironment, moduleEnvironmentVariables, documentConfig, parameterizeConfig } from './chunk-EFC6IHNF.js';
3
3
  import { cliM } from './chunk-2ZL5ORQ2.js';
4
4
  import { __commonJS, __export, __toESM } from './chunk-ZSDEVXZ7.js';
5
5
  import process15 from 'process';
@@ -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';
@@ -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
  });
@@ -4200,7 +4201,7 @@ async function createProject(options) {
4200
4201
  });
4201
4202
  await generateFromTemplates(projectPath, context);
4202
4203
  {
4203
- const { generateConfigFile: generateConfigFile2, generateEnvExample, generateProductionEnvironment: generateProductionEnvironment2 } = await import('./cli-config-templates-LWMD2I6V.js');
4204
+ const { generateConfigFile: generateConfigFile2, generateEnvExample, generateProductionEnvironment: generateProductionEnvironment2 } = await import('./cli-config-templates-JJD7YXKL.js');
4204
4205
  const configs = resolvedOptions.moduleConfigs;
4205
4206
  const isApiWorkspace = resolvedOptions.appType === "api";
4206
4207
  const isFullstack = resolvedOptions.appType === "fullstack";
@@ -25552,7 +25553,9 @@ var en_US_default = {
25552
25553
  deploy_middlewareMethod: "Enter POST or PUT.",
25553
25554
  deploy_configResolutionFailed: "Cannot resolve {path}. Check the configuration structure and array indices for {fields}.",
25554
25555
  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"
25556
+ deploy_s3Engine: "Choose the self-hosted S3 implementation",
25557
+ deploy_downloadUnavailableTitle: "Download link unavailable",
25558
+ deploy_downloadUnavailableInstruction: "Return to the download page to get a new link. If the download still fails, contact your administrator."
25556
25559
  };
25557
25560
 
25558
25561
  // ../deploy/messages/ja-JP.json
@@ -25695,7 +25698,9 @@ var ja_JP_default = {
25695
25698
  deploy_middlewareMethod: "POST \u307E\u305F\u306F PUT \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
25696
25699
  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
25700
  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"
25701
+ deploy_s3Engine: "\u30BB\u30EB\u30D5\u30DB\u30B9\u30C8 S3 \u306E\u5B9F\u88C5\u3092\u9078\u629E",
25702
+ deploy_downloadUnavailableTitle: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30EA\u30F3\u30AF\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093",
25703
+ 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
25704
  };
25700
25705
 
25701
25706
  // ../deploy/messages/zh-CN.json
@@ -25838,7 +25843,9 @@ var zh_CN_default2 = {
25838
25843
  deploy_middlewareMethod: "\u8BF7\u8F93\u5165 POST \u6216 PUT\u3002",
25839
25844
  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
25845
  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"
25846
+ deploy_s3Engine: "\u9009\u62E9\u81EA\u5EFA S3 \u670D\u52A1\u5B9E\u73B0",
25847
+ deploy_downloadUnavailableTitle: "\u4E0B\u8F7D\u94FE\u63A5\u65E0\u6CD5\u8BBF\u95EE",
25848
+ 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
25849
  };
25843
25850
 
25844
25851
  // ../deploy/src/deploy-i18n.ts
@@ -29745,9 +29752,12 @@ async function deployCommand(options) {
29745
29752
  let appDir = resolve(cwd, options.appDir ?? ".");
29746
29753
  let closeDeploy = null;
29747
29754
  let restoreProjectLogger;
29755
+ let configureProjectLogger;
29748
29756
  const originalEnv = { ...process15.env };
29749
29757
  const previousLogLevel = core.logger.getLevel();
29750
- core.logger.setLevel("fatal");
29758
+ const initialLevel = options.plan ? "fatal" : LogLevelSchema.safeParse(process15.env.HAI_CORE_LOGGING_LEVEL).data;
29759
+ if (initialLevel)
29760
+ core.logger.setLevel(initialLevel);
29751
29761
  try {
29752
29762
  if (options.inspectRemote && !options.plan)
29753
29763
  throw new Error(cliM("cli_deploy_plan_options"));
@@ -29782,9 +29792,11 @@ async function deployCommand(options) {
29782
29792
  try {
29783
29793
  const { core: projectCore } = await import(pathToFileURL(localRequire.resolve("@h-ai/core")).href);
29784
29794
  if (projectCore !== core) {
29785
- const level = projectCore.logger.getLevel();
29786
- projectCore.logger.setLevel("fatal");
29787
- restoreProjectLogger = () => projectCore.logger.setLevel(level);
29795
+ const level2 = projectCore.logger.getLevel();
29796
+ configureProjectLogger = (next) => projectCore.logger.setLevel(next);
29797
+ if (initialLevel)
29798
+ configureProjectLogger(initialLevel);
29799
+ restoreProjectLogger = () => projectCore.logger.setLevel(level2);
29788
29800
  }
29789
29801
  } catch {
29790
29802
  }
@@ -29877,6 +29889,11 @@ async function deployCommand(options) {
29877
29889
  return;
29878
29890
  }
29879
29891
  Object.assign(process15.env, environment.data.values);
29892
+ const level = LogLevelSchema.safeParse(process15.env.HAI_CORE_LOGGING_LEVEL);
29893
+ if (level.success) {
29894
+ core.logger.setLevel(level.data);
29895
+ configureProjectLogger?.(level.data);
29896
+ }
29880
29897
  spinner.start(cliM("cli_deploy_load_credentials"));
29881
29898
  const credResult = deploy.credentials.load();
29882
29899
  if (!credResult.success) {