@h-ai/cli 1.0.0-beta.22 → 1.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +11 -12
- package/README.ja.md +11 -12
- package/README.md +11 -12
- package/dist/{chunk-EFC6IHNF.js → chunk-CWMU5QU2.js} +486 -6
- package/dist/chunk-CWMU5QU2.js.map +1 -0
- package/dist/{chunk-2ZL5ORQ2.js → chunk-P2VZ3VV6.js} +2 -14
- package/dist/chunk-P2VZ3VV6.js.map +1 -0
- package/dist/cli-config-templates-OWLL4H6K.js +5 -0
- package/dist/{cli-config-templates-JJD7YXKL.js.map → cli-config-templates-OWLL4H6K.js.map} +1 -1
- package/dist/{cli-skill-templates-D6S2OQ6X.js → cli-skill-templates-JKF6E3PI.js} +3 -3
- package/dist/{cli-skill-templates-D6S2OQ6X.js.map → cli-skill-templates-JKF6E3PI.js.map} +1 -1
- package/dist/index.js +163 -257
- package/dist/index.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +14 -14
- package/templates/apps/fullstack/docs/security-configuration.md.hbs +3 -3
- package/templates/apps/fullstack/packages/{{projectName}}-serv/README.md.hbs +1 -1
- package/templates/apps/fullstack/packages/{{projectName}}-shared/tests/api-client.test.ts.hbs +4 -1
- package/templates/base/package.json.hbs +1 -1
- package/templates/skills/hai-ai/acp.md +68 -4
- package/templates/skills/hai-ai/guide.md +1 -1
- package/templates/skills/hai-ai/reference.md +1 -1
- package/templates/skills/hai-api-client/SKILL.md +1 -1
- package/templates/skills/hai-app-create/development.md +3 -3
- package/templates/skills/hai-app-create/logging.md +1 -1
- package/templates/skills/hai-audit/SKILL.md +1 -1
- package/templates/skills/hai-audit/reference.md +1 -1
- package/templates/skills/hai-build/SKILL.md +1 -1
- package/templates/skills/hai-build/paths.md +1 -1
- package/templates/skills/hai-crypto/SKILL.md +1 -1
- package/templates/skills/hai-crypto/reference.md +1 -1
- package/templates/skills/hai-deploy/SKILL.md +6 -8
- package/templates/skills/hai-deploy/middleware.md +2 -2
- package/templates/skills/hai-framework-sync/SKILL.md +4 -4
- package/templates/skills/hai-iam/SKILL.md +1 -1
- package/templates/skills/hai-iam/reference.md +1 -1
- package/templates/skills/hai-kit/reference.md +2 -2
- package/templates/skills/hai-reach/SKILL.md +1 -1
- package/templates/skills/hai-reldb/SKILL.md +1 -1
- package/templates/skills/hai-reldb/reference.md +1 -2
- package/templates/skills/hai-scheduler/reference.md +1 -1
- package/templates/skills/hai-serv/reference.md +2 -2
- package/templates/skills/hai-storage/reference.md +2 -2
- package/dist/chunk-2ZL5ORQ2.js.map +0 -1
- package/dist/chunk-EFC6IHNF.js.map +0 -1
- package/dist/cli-config-templates-JJD7YXKL.js +0 -5
- 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-
|
|
3
|
-
import { cliM } from './chunk-
|
|
2
|
+
import { generateConfigFile, runtimeEnvironmentVariables, renderEnvironment, generateProductionEnvironment, moduleEnvironmentVariables, documentConfig, parameterizeConfig } from './chunk-CWMU5QU2.js';
|
|
3
|
+
import { cliM } from './chunk-P2VZ3VV6.js';
|
|
4
4
|
import { __commonJS, __export, __toESM } from './chunk-ZSDEVXZ7.js';
|
|
5
|
-
import
|
|
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';
|
|
@@ -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 (
|
|
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
|
-
|
|
2876
|
+
process14.stdout.write(`${message}
|
|
2877
2877
|
`);
|
|
2878
2878
|
}
|
|
2879
2879
|
function writeCliError(message, error62) {
|
|
2880
|
-
|
|
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
|
-
|
|
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, (
|
|
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());
|
|
@@ -4152,14 +4152,6 @@ var PROJECT_NAME_REGEX = /^[a-z0-9-]+$/;
|
|
|
4152
4152
|
async function createProject(options) {
|
|
4153
4153
|
const spinner = ora();
|
|
4154
4154
|
try {
|
|
4155
|
-
if ([
|
|
4156
|
-
"template",
|
|
4157
|
-
"features",
|
|
4158
|
-
"examples",
|
|
4159
|
-
"yes"
|
|
4160
|
-
].some((key) => Object.hasOwn(options, key))) {
|
|
4161
|
-
throw new Error(cliM("cli_createOptionsRemoved"));
|
|
4162
|
-
}
|
|
4163
4155
|
const resolvedOptions = await resolveOptions(options);
|
|
4164
4156
|
if (!PROJECT_NAME_REGEX.test(resolvedOptions.name)) {
|
|
4165
4157
|
throw new Error(cliM("cli_createInvalidName", {
|
|
@@ -4201,7 +4193,7 @@ async function createProject(options) {
|
|
|
4201
4193
|
});
|
|
4202
4194
|
await generateFromTemplates(projectPath, context);
|
|
4203
4195
|
{
|
|
4204
|
-
const { generateConfigFile: generateConfigFile2, generateEnvExample, generateProductionEnvironment: generateProductionEnvironment2 } = await import('./cli-config-templates-
|
|
4196
|
+
const { generateConfigFile: generateConfigFile2, generateEnvExample, generateProductionEnvironment: generateProductionEnvironment2 } = await import('./cli-config-templates-OWLL4H6K.js');
|
|
4205
4197
|
const configs = resolvedOptions.moduleConfigs;
|
|
4206
4198
|
const isApiWorkspace = resolvedOptions.appType === "api";
|
|
4207
4199
|
const isFullstack = resolvedOptions.appType === "fullstack";
|
|
@@ -4328,7 +4320,7 @@ HAI_CRYPTO_TRANSPORT_SERVERKEYRING='${JSON.stringify(ring)}'
|
|
|
4328
4320
|
}
|
|
4329
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 });
|
|
4330
4322
|
}
|
|
4331
|
-
const { generateSkillFiles } = await import('./cli-skill-templates-
|
|
4323
|
+
const { generateSkillFiles } = await import('./cli-skill-templates-JKF6E3PI.js');
|
|
4332
4324
|
await generateSkillFiles(
|
|
4333
4325
|
projectPath,
|
|
4334
4326
|
resolvedOptions.features,
|
|
@@ -4386,7 +4378,7 @@ async function resolveOptions(options) {
|
|
|
4386
4378
|
writeCliMessage("");
|
|
4387
4379
|
const onCancel = () => {
|
|
4388
4380
|
writeCliMessage(chalk.red(cliM("cli_cancelledLine")));
|
|
4389
|
-
|
|
4381
|
+
process14.exit(1);
|
|
4390
4382
|
};
|
|
4391
4383
|
let projectName = options.name;
|
|
4392
4384
|
if (!projectName && useDefaults) {
|
|
@@ -4598,7 +4590,7 @@ async function promptModuleConfigs(features, projectName) {
|
|
|
4598
4590
|
const configs = {};
|
|
4599
4591
|
const onCancel = () => {
|
|
4600
4592
|
writeCliMessage(chalk.red(cliM("cli_cancelledLine")));
|
|
4601
|
-
|
|
4593
|
+
process14.exit(1);
|
|
4602
4594
|
};
|
|
4603
4595
|
writeCliMessage("");
|
|
4604
4596
|
writeCliMessage(chalk.bold(cliM("cli_createModuleConfig")));
|
|
@@ -4939,7 +4931,7 @@ function generateBuildDeploymentReadme(pm, appDir) {
|
|
|
4939
4931
|
return `### \u6784\u5EFA\u4E0E\u90E8\u7F72
|
|
4940
4932
|
|
|
4941
4933
|
\u521B\u5EFA\u65F6\u9ED8\u8BA4\u5305\u542B\u90E8\u7F72\u5DE5\u5177\uFF1B\u4E0D\u9700\u8981\u65F6\u4F7F\u7528 hai create --no-deploy\u3002
|
|
4942
|
-
\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\
|
|
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
|
|
4943
4935
|
|
|
4944
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
|
|
4945
4937
|
|
|
@@ -5491,7 +5483,7 @@ async function addModule(options) {
|
|
|
5491
5483
|
...baseDefinition,
|
|
5492
5484
|
deps: resolveFeatureDependencies([selected]).filter((feature) => feature !== selected)
|
|
5493
5485
|
};
|
|
5494
|
-
const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-
|
|
5486
|
+
const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-JKF6E3PI.js');
|
|
5495
5487
|
const allPackages = new Set(moduleDef.packages);
|
|
5496
5488
|
for (const dep of moduleDef.deps) {
|
|
5497
5489
|
for (const name of MODULE_MAP[dep]?.packages ?? [])
|
|
@@ -7060,10 +7052,10 @@ function defineLazyInternal(inst, key, compute) {
|
|
|
7060
7052
|
Object.defineProperty(this, key, { configurable: true, writable: true, value });
|
|
7061
7053
|
broke = broke || outer;
|
|
7062
7054
|
return value;
|
|
7063
|
-
} catch (
|
|
7055
|
+
} catch (err30) {
|
|
7064
7056
|
delete this[key];
|
|
7065
7057
|
broke = broke || outer;
|
|
7066
|
-
throw
|
|
7058
|
+
throw err30;
|
|
7067
7059
|
}
|
|
7068
7060
|
},
|
|
7069
7061
|
set(value) {
|
|
@@ -10727,7 +10719,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
10727
10719
|
var NONE = 0;
|
|
10728
10720
|
var ASSUMED = 1;
|
|
10729
10721
|
var PROVEN = 2;
|
|
10730
|
-
function isRecursive(inst, stack,
|
|
10722
|
+
function isRecursive(inst, stack, resolve15) {
|
|
10731
10723
|
const cached2 = recursive.get(inst);
|
|
10732
10724
|
if (cached2 !== void 0)
|
|
10733
10725
|
return cached2 ? PROVEN : NONE;
|
|
@@ -10737,7 +10729,7 @@ function isRecursive(inst, stack, resolve17) {
|
|
|
10737
10729
|
let result = NONE;
|
|
10738
10730
|
const check2 = (child) => {
|
|
10739
10731
|
if (result !== PROVEN && child?._zod) {
|
|
10740
|
-
const answer = isRecursive(child, stack,
|
|
10732
|
+
const answer = isRecursive(child, stack, resolve15);
|
|
10741
10733
|
if (answer > result)
|
|
10742
10734
|
result = answer;
|
|
10743
10735
|
}
|
|
@@ -10748,7 +10740,7 @@ function isRecursive(inst, stack, resolve17) {
|
|
|
10748
10740
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
10749
10741
|
if (!desc.enumerable)
|
|
10750
10742
|
continue;
|
|
10751
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
10743
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve15) : NONE;
|
|
10752
10744
|
if (child > answer)
|
|
10753
10745
|
answer = child;
|
|
10754
10746
|
}
|
|
@@ -10812,7 +10804,7 @@ function isRecursive(inst, stack, resolve17) {
|
|
|
10812
10804
|
break;
|
|
10813
10805
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
10814
10806
|
case "lazy": {
|
|
10815
|
-
const inner = def._cachedInner ?? (
|
|
10807
|
+
const inner = def._cachedInner ?? (resolve15 ? inst._zod.innerType : void 0);
|
|
10816
10808
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
10817
10809
|
break;
|
|
10818
10810
|
}
|
|
@@ -18630,9 +18622,9 @@ function compile(schema, options) {
|
|
|
18630
18622
|
const clone2 = withParser(schema, parser);
|
|
18631
18623
|
clone2._zod.bag.validator = compileValidator(schema, parser);
|
|
18632
18624
|
return clone2;
|
|
18633
|
-
} catch (
|
|
18625
|
+
} catch (err30) {
|
|
18634
18626
|
if (options?.strict)
|
|
18635
|
-
throw
|
|
18627
|
+
throw err30;
|
|
18636
18628
|
return schema;
|
|
18637
18629
|
}
|
|
18638
18630
|
}
|
|
@@ -18722,8 +18714,8 @@ ${code}
|
|
|
18722
18714
|
try {
|
|
18723
18715
|
const factory = new F(...constantNames, factoryCode);
|
|
18724
18716
|
fn = factory(...constantValues);
|
|
18725
|
-
} catch (
|
|
18726
|
-
throw new ZodCompileUnsupportedError(`this schema (generated code failed to evaluate: ${
|
|
18717
|
+
} catch (err30) {
|
|
18718
|
+
throw new ZodCompileUnsupportedError(`this schema (generated code failed to evaluate: ${err30.message})`);
|
|
18727
18719
|
}
|
|
18728
18720
|
if (options?.debug) {
|
|
18729
18721
|
fn.code = fullCode;
|
|
@@ -18761,9 +18753,9 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
18761
18753
|
const varCounter = ctx.varCounter;
|
|
18762
18754
|
try {
|
|
18763
18755
|
return generateCheck(doc, ctx, schema, accessor, needsValue);
|
|
18764
|
-
} catch (
|
|
18765
|
-
if (!(
|
|
18766
|
-
throw
|
|
18756
|
+
} catch (err30) {
|
|
18757
|
+
if (!(err30 instanceof ZodCompileUnsupportedError) || !err30.islandable)
|
|
18758
|
+
throw err30;
|
|
18767
18759
|
doc.content.length = contentLen;
|
|
18768
18760
|
if (ctx.constants.size > constantCount) {
|
|
18769
18761
|
const trailing = Array.from(ctx.constants.keys()).slice(constantCount);
|
|
@@ -25369,17 +25361,14 @@ function date4(params) {
|
|
|
25369
25361
|
// ../deploy/src/deploy-artifact.ts
|
|
25370
25362
|
external_exports.object({
|
|
25371
25363
|
/** 清单格式版本,与应用版本和部署环境无关。 */
|
|
25372
|
-
version: external_exports.
|
|
25373
|
-
external_exports.literal(4),
|
|
25374
|
-
external_exports.literal(5)
|
|
25375
|
-
]),
|
|
25364
|
+
version: external_exports.literal(5),
|
|
25376
25365
|
/** 主运行服务:独立后端为 serv,独立浏览器站点(静态或 SSR)为 web。 */
|
|
25377
25366
|
primaryService: external_exports.enum(["serv", "web"]),
|
|
25378
25367
|
/** 应用根 package.json 的版本,用于归档、Compose 与桌面交付;最长 80 字符。 */
|
|
25379
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),
|
|
25380
25369
|
/** 本次构建标识;同一应用版本允许重复构建。 */
|
|
25381
25370
|
buildId: external_exports.string().max(128).regex(/^[a-z0-9][\w.+-]*$/i),
|
|
25382
|
-
/** 构建启动时观察到的 Git
|
|
25371
|
+
/** 构建启动时观察到的 Git 来源。 */
|
|
25383
25372
|
source: external_exports.object({
|
|
25384
25373
|
/** 工程 package.json 所在仓库的提交 SHA;无法确定时为 unknown。 */
|
|
25385
25374
|
commit: external_exports.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64}|unknown)$/),
|
|
@@ -25390,8 +25379,8 @@ external_exports.object({
|
|
|
25390
25379
|
partial: external_exports.boolean().default(false),
|
|
25391
25380
|
/** 是否包含浏览器端;仅构建 serv 时也保留完整工程的 Web 拓扑。 */
|
|
25392
25381
|
hasWeb: external_exports.boolean().default(false),
|
|
25393
|
-
/** Web
|
|
25394
|
-
webBasePath: external_exports.string().refine((value) => value === "" || /^\/[\w.-]+(?:\/[\w.-]+)*$/.test(value) && !value.split("/").some((segment) => segment === "." || segment === ".."))
|
|
25382
|
+
/** Web 构建的公开挂载目录,无末尾斜杠;空字符串表示域名根目录。增量制品须保留完整拓扑的同一值。 */
|
|
25383
|
+
webBasePath: external_exports.string().refine((value) => value === "" || /^\/[\w.-]+(?:\/[\w.-]+)*$/.test(value) && !value.split("/").some((segment) => segment === "." || segment === "..")),
|
|
25395
25384
|
/** 工程显式配置的后端端口,部分构建未包含 serv 时仍保留。 */
|
|
25396
25385
|
servContainerPort: external_exports.number().int().min(1).max(65535).optional(),
|
|
25397
25386
|
/** 工程显式配置的 Web 端口,部分构建未包含 web 镜像时仍保留;缺省使用部署默认值。 */
|
|
@@ -25406,12 +25395,12 @@ external_exports.object({
|
|
|
25406
25395
|
imageRef: external_exports.string().regex(/^[a-z0-9][a-z0-9./:_-]*:[a-z0-9_][a-z0-9_.-]*$/).refine((value) => !value.endsWith(":latest")),
|
|
25407
25396
|
/** tar 内容的 SHA-256,用于部署前校验。 */
|
|
25408
25397
|
sha256: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
25409
|
-
/** 引擎实际构建的镜像 OS
|
|
25398
|
+
/** 引擎实际构建的镜像 OS/架构。 */
|
|
25410
25399
|
platform: external_exports.string().regex(/^[a-z0-9][a-z0-9_.-]*\/[a-z0-9][a-z0-9_.-]*$/).optional(),
|
|
25411
25400
|
/** 容器内部监听端口;服务器公开端口由部署选择。 */
|
|
25412
25401
|
containerPort: external_exports.number().int().min(1).max(65535).optional()
|
|
25413
25402
|
})).min(1).max(2).refine((images) => new Set(images.map((image) => image.name)).size === images.length)
|
|
25414
|
-
}).refine((artifact) =>
|
|
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"));
|
|
25415
25404
|
|
|
25416
25405
|
// ../deploy/messages/en-US.json
|
|
25417
25406
|
var en_US_default = {
|
|
@@ -25521,9 +25510,7 @@ var en_US_default = {
|
|
|
25521
25510
|
deploy_uploadPasswordCancelled: "Password input cancelled; no server connection was made.",
|
|
25522
25511
|
deploy_uploadPasswordInvalid: "SSH passwords must contain 1\u20131023 UTF-8 bytes without line breaks.",
|
|
25523
25512
|
deploy_managedSecretsInvalid: "Invalid generated middleware credential candidates. Rebuild the deployment bundle; server credentials will not be rotated automatically.",
|
|
25524
|
-
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",
|
|
25525
25513
|
deploy_projectNameRequired: "The root package.json.name is missing or cannot be normalized into an image and deployment resource identity.",
|
|
25526
|
-
deploy_projectNameOverrideRemoved: "Deployment identity comes from the root package.json.name; remove the obsolete projectName override.",
|
|
25527
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.",
|
|
25528
25515
|
deploy_httpsPortsInvalid: "HTTP and HTTPS ports must differ; Let\u2019s Encrypt HTTP-01 requires host port 80.",
|
|
25529
25516
|
deploy_httpsCertificateInvalid: "Invalid HTTPS certificate. Check readable PEM files, matching unencrypted private key, validity dates and domain, then repackage.",
|
|
@@ -25666,9 +25653,7 @@ var ja_JP_default = {
|
|
|
25666
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",
|
|
25667
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",
|
|
25668
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",
|
|
25669
|
-
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",
|
|
25670
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",
|
|
25671
|
-
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",
|
|
25672
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",
|
|
25673
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",
|
|
25674
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",
|
|
@@ -25811,9 +25796,7 @@ var zh_CN_default2 = {
|
|
|
25811
25796
|
deploy_uploadPasswordCancelled: "\u5DF2\u53D6\u6D88\u5BC6\u7801\u8F93\u5165\uFF0C\u5C1A\u672A\u8FDE\u63A5\u670D\u52A1\u5668\u3002",
|
|
25812
25797
|
deploy_uploadPasswordInvalid: "SSH \u5BC6\u7801\u987B\u4E3A 1\u20131023 \u4E2A UTF-8 \u5B57\u8282\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u6362\u884C\u3002",
|
|
25813
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",
|
|
25814
|
-
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",
|
|
25815
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",
|
|
25816
|
-
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",
|
|
25817
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",
|
|
25818
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",
|
|
25819
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",
|
|
@@ -26122,7 +26105,7 @@ function resolveImageReference(reference, source) {
|
|
|
26122
26105
|
return `${url2.host}${url2.pathname.replace(/\/$/, "")}/${parts.join("/")}`;
|
|
26123
26106
|
}
|
|
26124
26107
|
function systemProxy() {
|
|
26125
|
-
if (
|
|
26108
|
+
if (process14.platform === "win32") {
|
|
26126
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";
|
|
26127
26110
|
const value = JSON.parse(execFileSync("powershell.exe", [
|
|
26128
26111
|
"-NoProfile",
|
|
@@ -26141,7 +26124,7 @@ function systemProxy() {
|
|
|
26141
26124
|
bypass: value.bypass?.split(";").filter((item) => item !== "<local>").join(",")
|
|
26142
26125
|
};
|
|
26143
26126
|
}
|
|
26144
|
-
if (
|
|
26127
|
+
if (process14.platform === "darwin") {
|
|
26145
26128
|
const output2 = execFileSync("/usr/sbin/scutil", ["--proxy"], { encoding: "utf8", timeout: 5e3 });
|
|
26146
26129
|
const get = (key) => output2.match(new RegExp(`^\\s*${key}\\s*:\\s*(.+)$`, "m"))?.[1]?.trim();
|
|
26147
26130
|
if (get("ProxyAutoConfigEnable") === "1" || get("ProxyAutoDiscoveryEnable") === "1")
|
|
@@ -26157,7 +26140,7 @@ function resolveDownloadProxy(config2) {
|
|
|
26157
26140
|
const mode = config2?.mode ?? "inherit";
|
|
26158
26141
|
if (!["inherit", "system", "custom", "none"].includes(mode) || config2?.url !== void 0 && mode !== "custom")
|
|
26159
26142
|
throw new Error(deployM("deploy_downloadInvalid"));
|
|
26160
|
-
const values = mode === "system" ? systemProxy() : mode === "custom" ? { http: config2?.url, https: config2?.url } : mode === "inherit" ? { http:
|
|
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 } : {};
|
|
26161
26144
|
if (mode === "custom" && !config2?.url)
|
|
26162
26145
|
throw new Error(deployM("deploy_downloadInvalid"));
|
|
26163
26146
|
const normalize = (value) => {
|
|
@@ -26184,10 +26167,10 @@ function resolveDownloadProxy(config2) {
|
|
|
26184
26167
|
https_proxy: https,
|
|
26185
26168
|
NO_PROXY: bypass,
|
|
26186
26169
|
no_proxy: bypass,
|
|
26187
|
-
ALL_PROXY: mode === "inherit" ?
|
|
26188
|
-
all_proxy: mode === "inherit" ?
|
|
26189
|
-
FTP_PROXY: mode === "inherit" ?
|
|
26190
|
-
ftp_proxy: mode === "inherit" ?
|
|
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 ?? "" : ""
|
|
26191
26174
|
};
|
|
26192
26175
|
}
|
|
26193
26176
|
function normalizeProjectName(name) {
|
|
@@ -27044,6 +27027,7 @@ var en_US_default2 = {
|
|
|
27044
27027
|
crypto_transportBodyLimitInvalid: "Transport plaintext limit must be an integer between 1024 and 67108864 bytes",
|
|
27045
27028
|
crypto_transportBodyTooLarge: "Encrypted transport payload exceeds the configured byte limit",
|
|
27046
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",
|
|
27047
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.",
|
|
27048
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.",
|
|
27049
27033
|
crypto_transportBodyLimitConflict: "Explicit transport limit {limit} bytes is below the enabled module requirement of {required} bytes; adjust the module budget or explicit limit",
|
|
@@ -27106,6 +27090,7 @@ var ja_JP_default2 = {
|
|
|
27106
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",
|
|
27107
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",
|
|
27108
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",
|
|
27109
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",
|
|
27110
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",
|
|
27111
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",
|
|
@@ -27168,6 +27153,7 @@ var zh_CN_default3 = {
|
|
|
27168
27153
|
crypto_transportBodyLimitInvalid: "\u4F20\u8F93\u660E\u6587\u5BB9\u91CF\u5FC5\u987B\u662F 1024 \u5230 67108864 \u5B57\u8282\u4E4B\u95F4\u7684\u6574\u6570",
|
|
27169
27154
|
crypto_transportBodyTooLarge: "\u52A0\u5BC6\u4F20\u8F93\u62A5\u6587\u8D85\u8FC7\u914D\u7F6E\u7684\u5B57\u8282\u4E0A\u9650",
|
|
27170
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",
|
|
27171
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",
|
|
27172
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",
|
|
27173
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",
|
|
@@ -27593,29 +27579,6 @@ function required2(name, defaultValue, kind) {
|
|
|
27593
27579
|
}
|
|
27594
27580
|
]
|
|
27595
27581
|
});
|
|
27596
|
-
var nameSchema = external_exports.string().regex(/^[a-z0-9][\w.-]{0,127}$/i);
|
|
27597
|
-
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));
|
|
27598
|
-
external_exports.strictObject({
|
|
27599
|
-
version: external_exports.literal(1),
|
|
27600
|
-
projectName: nameSchema,
|
|
27601
|
-
credentials: external_exports.strictObject({
|
|
27602
|
-
DB_PASSWORD: passwordSchema.optional(),
|
|
27603
|
-
STORAGE_PASSWORD: passwordSchema.optional(),
|
|
27604
|
-
LDAP_PASSWORD: passwordSchema.optional()
|
|
27605
|
-
}),
|
|
27606
|
-
services: external_exports.array(external_exports.strictObject({
|
|
27607
|
-
service: external_exports.enum(["db", "vecdb", "storage", "ldap"]),
|
|
27608
|
-
container: nameSchema,
|
|
27609
|
-
kind: external_exports.enum(["postgresql", "mysql", "s3", "ldap"]),
|
|
27610
|
-
volumes: external_exports.array(nameSchema).min(1).max(8),
|
|
27611
|
-
username: external_exports.string().min(1).max(128).default("hai"),
|
|
27612
|
-
database: external_exports.string().min(1).max(128).default("hai"),
|
|
27613
|
-
bucket: external_exports.string().regex(/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/).default("hai"),
|
|
27614
|
-
accessKeyId: external_exports.string().min(1).max(128).default("hai-storage"),
|
|
27615
|
-
region: external_exports.string().regex(/^[a-z0-9-]+$/).default("us-east-1"),
|
|
27616
|
-
bindDn: external_exports.string().min(1).max(512).default("cn=admin,dc=example,dc=org")
|
|
27617
|
-
})).min(1).max(4)
|
|
27618
|
-
});
|
|
27619
27582
|
function resolveCoreInputs(environment) {
|
|
27620
27583
|
const resolved = core.config.resolve({
|
|
27621
27584
|
name: "core",
|
|
@@ -27634,7 +27597,7 @@ function resolveCoreInputs(environment) {
|
|
|
27634
27597
|
);
|
|
27635
27598
|
}
|
|
27636
27599
|
function nativeNameEnvironment(envDir) {
|
|
27637
|
-
let inputs =
|
|
27600
|
+
let inputs = process14.env;
|
|
27638
27601
|
let selectedMode;
|
|
27639
27602
|
if (envDir) {
|
|
27640
27603
|
selectedMode = /** @type {string | undefined} */
|
|
@@ -27688,7 +27651,7 @@ async function resolveBuildDownloads(directory, options) {
|
|
|
27688
27651
|
const savedImage = object2(sources.image);
|
|
27689
27652
|
const savedNpm = object2(sources.npm);
|
|
27690
27653
|
const savedProxy = object2(build.proxy);
|
|
27691
|
-
const interactive = !!
|
|
27654
|
+
const interactive = !!process14.stdin.isTTY && !options.yes;
|
|
27692
27655
|
const choose = async (message, values) => {
|
|
27693
27656
|
const answer = await prompts({
|
|
27694
27657
|
type: "select",
|
|
@@ -27852,7 +27815,7 @@ async function preflightDownloadProxy(runtime, proxy, report = writeCliMessage)
|
|
|
27852
27815
|
const environment = resolveDownloadProxy(proxy);
|
|
27853
27816
|
for (const value of new Set([environment.HTTP_PROXY, environment.HTTPS_PROXY].filter(Boolean))) {
|
|
27854
27817
|
const url2 = new URL(value);
|
|
27855
|
-
await new Promise((
|
|
27818
|
+
await new Promise((resolve15, reject) => {
|
|
27856
27819
|
const socket = connect({
|
|
27857
27820
|
host: url2.hostname.replace(/^\[|\]$/g, ""),
|
|
27858
27821
|
port: Number(url2.port || (url2.protocol === "https:" ? 443 : 80))
|
|
@@ -27860,7 +27823,7 @@ async function preflightDownloadProxy(runtime, proxy, report = writeCliMessage)
|
|
|
27860
27823
|
socket.setTimeout(3e3);
|
|
27861
27824
|
socket.once("connect", () => {
|
|
27862
27825
|
socket.destroy();
|
|
27863
|
-
|
|
27826
|
+
resolve15();
|
|
27864
27827
|
});
|
|
27865
27828
|
const fail = () => {
|
|
27866
27829
|
socket.destroy();
|
|
@@ -28125,16 +28088,16 @@ async function buildContainerAndroid(root, apps, options, publish) {
|
|
|
28125
28088
|
let keystore;
|
|
28126
28089
|
if (!debug) {
|
|
28127
28090
|
const values = {
|
|
28128
|
-
HAI_ANDROID_STORE_PASSWORD:
|
|
28129
|
-
HAI_ANDROID_KEY_ALIAS:
|
|
28130
|
-
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
|
|
28131
28094
|
};
|
|
28132
28095
|
for (const [key, value] of Object.entries(values)) {
|
|
28133
28096
|
if (!value)
|
|
28134
28097
|
throw new Error(cliM("cli_build_android_signing"));
|
|
28135
28098
|
signing[key] = value;
|
|
28136
28099
|
}
|
|
28137
|
-
const path10 =
|
|
28100
|
+
const path10 = process14.env.HAI_ANDROID_KEYSTORE;
|
|
28138
28101
|
if (!path10 || !existsSync(resolve(root, path10)) || !statSync(resolve(root, path10)).isFile())
|
|
28139
28102
|
throw new Error(cliM("cli_build_android_signing"));
|
|
28140
28103
|
keystore = resolve(root, path10);
|
|
@@ -28151,7 +28114,7 @@ async function buildContainerAndroid(root, apps, options, publish) {
|
|
|
28151
28114
|
const proxyArgs = buildProxyArguments(downloads.proxy, runtime, network);
|
|
28152
28115
|
const engineArgs = [
|
|
28153
28116
|
...network === void 0 ? [] : ["--network", network],
|
|
28154
|
-
...runtime === "docker" &&
|
|
28117
|
+
...runtime === "docker" && process14.platform === "linux" && network !== "host" ? ["--add-host", "host.docker.internal:host-gateway"] : [],
|
|
28155
28118
|
...runtime === "podman" && downloads.proxy.mode === "none" ? ["--http-proxy=false"] : []
|
|
28156
28119
|
];
|
|
28157
28120
|
try {
|
|
@@ -28202,8 +28165,8 @@ async function buildContainerAndroid(root, apps, options, publish) {
|
|
|
28202
28165
|
argument.slice(equals + 1)
|
|
28203
28166
|
];
|
|
28204
28167
|
}));
|
|
28205
|
-
const uid =
|
|
28206
|
-
const gid =
|
|
28168
|
+
const uid = process14.getuid?.();
|
|
28169
|
+
const gid = process14.getgid?.();
|
|
28207
28170
|
const userArgs = uid === void 0 || gid === void 0 ? [] : [
|
|
28208
28171
|
...runtime === "podman" && uid !== 0 ? ["--userns=keep-id"] : [],
|
|
28209
28172
|
"--user",
|
|
@@ -28296,7 +28259,7 @@ async function buildContainerAndroid(root, apps, options, publish) {
|
|
|
28296
28259
|
}
|
|
28297
28260
|
function gradleCommand(debug) {
|
|
28298
28261
|
const task = debug ? "assembleDebug" : "assembleRelease";
|
|
28299
|
-
return
|
|
28262
|
+
return process14.platform === "win32" ? [
|
|
28300
28263
|
"cmd.exe",
|
|
28301
28264
|
"/d",
|
|
28302
28265
|
"/c",
|
|
@@ -28317,7 +28280,7 @@ function isAppPackage(path10, platform, debug) {
|
|
|
28317
28280
|
return parts.at(-2) === (debug ? "debug" : "release") && path10.endsWith(".apk") && !path10.endsWith("-unsigned.apk");
|
|
28318
28281
|
}
|
|
28319
28282
|
async function buildMobileApp(root, directories, platform, run2, debug = false, runGradle) {
|
|
28320
|
-
if (!directories.length || platform === "ios" &&
|
|
28283
|
+
if (!directories.length || platform === "ios" && process14.platform !== "darwin")
|
|
28321
28284
|
throw new Error(cliM("cli_build_app_platform"));
|
|
28322
28285
|
const outputs = [];
|
|
28323
28286
|
for (const item of directories) {
|
|
@@ -28680,15 +28643,15 @@ async function forwardWindowsBuildOutput(source, destination) {
|
|
|
28680
28643
|
|
|
28681
28644
|
// src/commands/cli-build.ts
|
|
28682
28645
|
async function run(command, args, cwd, quiet = false, identity, compileEnvironment, progressOnStderr = false) {
|
|
28683
|
-
await new Promise((
|
|
28684
|
-
const env = Object.fromEntries(Object.entries(
|
|
28646
|
+
await new Promise((resolve15, reject) => {
|
|
28647
|
+
const env = Object.fromEntries(Object.entries(process14.env).filter(([key]) => !/^(?:HAI_|PUBLIC_|VITE_)/.test(key)));
|
|
28685
28648
|
Object.assign(env, compileEnvironment);
|
|
28686
28649
|
if (identity) {
|
|
28687
28650
|
env.HAI_BUILD_ID = identity.buildId;
|
|
28688
28651
|
env.HAI_BUILD_COMMIT = identity.commit;
|
|
28689
28652
|
}
|
|
28690
28653
|
env.NODE_ENV = "production";
|
|
28691
|
-
if (
|
|
28654
|
+
if (process14.platform === "win32") {
|
|
28692
28655
|
env.npm_config_reporter = "append-only";
|
|
28693
28656
|
env.pnpm_config_reporter = "append-only";
|
|
28694
28657
|
}
|
|
@@ -28696,8 +28659,8 @@ async function run(command, args, cwd, quiet = false, identity, compileEnvironme
|
|
|
28696
28659
|
if (env.CI === "1" || env.CI === "0") {
|
|
28697
28660
|
env.CI = env.CI === "1" ? "true" : "false";
|
|
28698
28661
|
}
|
|
28699
|
-
const windowsOutput = !quiet &&
|
|
28700
|
-
const stdio = quiet ? "ignore" : windowsOutput ? ["inherit", "pipe", "pipe"] : progressOnStderr ? ["inherit",
|
|
28662
|
+
const windowsOutput = !quiet && process14.platform === "win32";
|
|
28663
|
+
const stdio = quiet ? "ignore" : windowsOutput ? ["inherit", "pipe", "pipe"] : progressOnStderr ? ["inherit", process14.stderr, "inherit"] : "inherit";
|
|
28701
28664
|
const child = spawn(command, args, {
|
|
28702
28665
|
cwd,
|
|
28703
28666
|
env,
|
|
@@ -28708,14 +28671,14 @@ async function run(command, args, cwd, quiet = false, identity, compileEnvironme
|
|
|
28708
28671
|
let output2 = Promise.resolve();
|
|
28709
28672
|
if (windowsOutput && child.stdout && child.stderr) {
|
|
28710
28673
|
output2 = Promise.all([
|
|
28711
|
-
forwardWindowsBuildOutput(child.stdout, progressOnStderr ?
|
|
28712
|
-
forwardWindowsBuildOutput(child.stderr,
|
|
28674
|
+
forwardWindowsBuildOutput(child.stdout, progressOnStderr ? process14.stderr : process14.stdout),
|
|
28675
|
+
forwardWindowsBuildOutput(child.stderr, process14.stderr)
|
|
28713
28676
|
]).then(() => void 0);
|
|
28714
28677
|
void output2.catch(() => child.kill());
|
|
28715
28678
|
}
|
|
28716
28679
|
child.once("error", reject);
|
|
28717
28680
|
child.once(windowsOutput && child.stdout && child.stderr ? "close" : "exit", (code) => {
|
|
28718
|
-
void output2.then(() => code === 0 ?
|
|
28681
|
+
void output2.then(() => code === 0 ? resolve15() : reject(new Error(cliM("cli_build_failed", {
|
|
28719
28682
|
params: {
|
|
28720
28683
|
command,
|
|
28721
28684
|
code: String(code)
|
|
@@ -28725,12 +28688,12 @@ async function run(command, args, cwd, quiet = false, identity, compileEnvironme
|
|
|
28725
28688
|
});
|
|
28726
28689
|
}
|
|
28727
28690
|
async function pnpm(args, cwd, identity, compileEnvironment) {
|
|
28728
|
-
const entry =
|
|
28691
|
+
const entry = process14.env.npm_execpath;
|
|
28729
28692
|
if (entry && /(?:^|[/\\])pnpm(?:-native)?(?:\.exe|\.[cm]?js)?$/i.test(entry)) {
|
|
28730
|
-
return /\.[cm]?js$/i.test(entry) ? run(
|
|
28693
|
+
return /\.[cm]?js$/i.test(entry) ? run(process14.execPath, [entry, ...args], cwd, false, identity, compileEnvironment) : run(entry, args, cwd, false, identity, compileEnvironment);
|
|
28731
28694
|
}
|
|
28732
|
-
if (
|
|
28733
|
-
const directories = (
|
|
28695
|
+
if (process14.platform === "win32") {
|
|
28696
|
+
const directories = (process14.env.PATH ?? "").split(";");
|
|
28734
28697
|
for (const directory of directories) {
|
|
28735
28698
|
const executable = join(directory, "pnpm.exe");
|
|
28736
28699
|
if (existsSync(executable))
|
|
@@ -28738,7 +28701,7 @@ async function pnpm(args, cwd, identity, compileEnvironment) {
|
|
|
28738
28701
|
for (const relative9 of ["node_modules/pnpm/bin/pnpm.cjs", "pnpm.cjs"]) {
|
|
28739
28702
|
const candidate = join(directory, relative9);
|
|
28740
28703
|
if (existsSync(candidate))
|
|
28741
|
-
return run(
|
|
28704
|
+
return run(process14.execPath, [candidate, ...args], cwd, false, identity, compileEnvironment);
|
|
28742
28705
|
}
|
|
28743
28706
|
}
|
|
28744
28707
|
throw new Error(cliM("cli_build_use_pnpm"));
|
|
@@ -28746,8 +28709,8 @@ async function pnpm(args, cwd, identity, compileEnvironment) {
|
|
|
28746
28709
|
return run("pnpm", args, cwd, false, identity, compileEnvironment);
|
|
28747
28710
|
}
|
|
28748
28711
|
function staticCompileEnvironment(target) {
|
|
28749
|
-
const flag =
|
|
28750
|
-
const base =
|
|
28712
|
+
const flag = process14.env.HAI_BUILD_STATIC;
|
|
28713
|
+
const base = process14.env.PUBLIC_BASE_PATH;
|
|
28751
28714
|
if (flag !== void 0 && flag !== "" && flag !== "0" && flag !== "1")
|
|
28752
28715
|
throw new Error(cliM("cli_build_static_flag"));
|
|
28753
28716
|
if (base && (!/^\/[\w.-]+(?:\/[\w.-]+)*$/.test(base) || base.split("/").some((segment) => segment === "." || segment === "..")))
|
|
@@ -28869,7 +28832,7 @@ async function buildRuntime(cwd, choice) {
|
|
|
28869
28832
|
throw new Error(cliM("cli_build_runtime_missing"));
|
|
28870
28833
|
}
|
|
28871
28834
|
async function buildCommand(options) {
|
|
28872
|
-
const directory = resolve(options.cwd ??
|
|
28835
|
+
const directory = resolve(options.cwd ?? process14.cwd());
|
|
28873
28836
|
const target = options.target ?? "compile";
|
|
28874
28837
|
const concurrency = Number(options.concurrency ?? 2);
|
|
28875
28838
|
if (![1, 2].includes(concurrency))
|
|
@@ -28934,9 +28897,9 @@ async function buildCommand(options) {
|
|
|
28934
28897
|
}
|
|
28935
28898
|
if (target === "desktop") {
|
|
28936
28899
|
const platforms = { win32: "windows", linux: "linux", darwin: "macos" };
|
|
28937
|
-
const host = platforms[
|
|
28900
|
+
const host = platforms[process14.platform];
|
|
28938
28901
|
const platform = options.platform ?? host;
|
|
28939
|
-
const arch = options.arch ??
|
|
28902
|
+
const arch = options.arch ?? process14.arch;
|
|
28940
28903
|
if (!platform || platform !== host || !["x64", "arm64"].includes(arch))
|
|
28941
28904
|
throw new Error(cliM("cli_build_native_host"));
|
|
28942
28905
|
if (!config2.desktop?.length)
|
|
@@ -28947,7 +28910,7 @@ async function buildCommand(options) {
|
|
|
28947
28910
|
const nativeEnvironment = nativeNameEnvironment(cwd);
|
|
28948
28911
|
for (const item of config2.desktop) {
|
|
28949
28912
|
const directory2 = nativeProjectDirectory(cwd, item);
|
|
28950
|
-
const cargo = resolve(directory2, "src-tauri",
|
|
28913
|
+
const cargo = resolve(directory2, "src-tauri", process14.env.CARGO_TARGET_DIR || "target");
|
|
28951
28914
|
const output2 = join(cargo, rustTarget, debug ? "debug" : "release", "bundle");
|
|
28952
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));
|
|
28953
28916
|
const before = bundlesOnDisk();
|
|
@@ -28987,7 +28950,7 @@ async function buildCommand(options) {
|
|
|
28987
28950
|
if (selected && (selected.some((name) => !config2.images.some((image) => image.name === name)) || new Set(selected).size !== selected.length))
|
|
28988
28951
|
throw new Error(cliM("cli_build_selection_invalid"));
|
|
28989
28952
|
const images = config2.images.filter((image) => !selected || selected.includes(image.name));
|
|
28990
|
-
const webBasePath = compileEnvironment.PUBLIC_BASE_PATH;
|
|
28953
|
+
const webBasePath = compileEnvironment.PUBLIC_BASE_PATH ?? "";
|
|
28991
28954
|
if (webBasePath && !config2.images.some((image) => image.name === "web"))
|
|
28992
28955
|
throw new Error(cliM("cli_build_base_requires_web"));
|
|
28993
28956
|
for (const image of images) {
|
|
@@ -29003,7 +28966,8 @@ async function buildCommand(options) {
|
|
|
29003
28966
|
resolve(cwd, image.dockerfile)
|
|
29004
28967
|
]);
|
|
29005
28968
|
const artifact = {
|
|
29006
|
-
version:
|
|
28969
|
+
version: 5,
|
|
28970
|
+
webBasePath,
|
|
29007
28971
|
primaryService: config2.images.some((image) => image.name === "serv") ? "serv" : "web",
|
|
29008
28972
|
appVersion,
|
|
29009
28973
|
buildId,
|
|
@@ -29018,12 +28982,8 @@ async function buildCommand(options) {
|
|
|
29018
28982
|
const downloads = await resolveBuildDownloads(cwd, options.json ? { ...options, yes: true } : options);
|
|
29019
28983
|
for (const image of images) validateDownloadDockerfile(resolve(cwd, image.dockerfile), downloads);
|
|
29020
28984
|
const runtime = await buildRuntime(cwd, options.runtime);
|
|
29021
|
-
await preflightDownloadProxy(runtime, downloads.proxy, options.json ? (message) =>
|
|
28985
|
+
await preflightDownloadProxy(runtime, downloads.proxy, options.json ? (message) => process14.stderr.write(`${message}
|
|
29022
28986
|
`) : void 0);
|
|
29023
|
-
if (webBasePath) {
|
|
29024
|
-
artifact.version = 5;
|
|
29025
|
-
artifact.webBasePath = webBasePath;
|
|
29026
|
-
}
|
|
29027
28987
|
for (const image of config2.images) {
|
|
29028
28988
|
if (image.containerPort !== void 0) {
|
|
29029
28989
|
artifact[image.name === "serv" ? "servContainerPort" : "webContainerPort"] = image.containerPort;
|
|
@@ -29049,8 +29009,8 @@ async function buildCommand(options) {
|
|
|
29049
29009
|
"-t",
|
|
29050
29010
|
imageRef
|
|
29051
29011
|
];
|
|
29052
|
-
const testRun =
|
|
29053
|
-
const testLedger =
|
|
29012
|
+
const testRun = process14.env.HAI_TEST_IMAGE_RUN;
|
|
29013
|
+
const testLedger = process14.env.HAI_TEST_IMAGE_LEDGER;
|
|
29054
29014
|
if (testLedger && /^[a-f0-9-]{36}$/.test(testRun ?? "")) {
|
|
29055
29015
|
const label = `org.h-ai.test.image-run=${testRun}`;
|
|
29056
29016
|
args.push("--label", label);
|
|
@@ -29064,7 +29024,7 @@ async function buildCommand(options) {
|
|
|
29064
29024
|
for (const match of dockerfile.matchAll(/^ARG (HAI_(?:NODE|NGINX)_IMAGE)=(\S+)\s*$/gm))
|
|
29065
29025
|
args.push("--build-arg", `${match[1]}=${resolveImageReference(match[2], downloads.imageSource)}`);
|
|
29066
29026
|
args.push("--build-arg", `HAI_NPM_REGISTRY=${downloads.npmRegistry}`, ...buildProxyArguments(downloads.proxy, runtime, options.network));
|
|
29067
|
-
if (runtime === "docker" &&
|
|
29027
|
+
if (runtime === "docker" && process14.platform === "linux" && options.network !== "host")
|
|
29068
29028
|
args.push("--add-host", "host.docker.internal:host-gateway");
|
|
29069
29029
|
if (options.network !== void 0)
|
|
29070
29030
|
args.push("--network", options.network);
|
|
@@ -29116,7 +29076,7 @@ async function buildCommand(options) {
|
|
|
29116
29076
|
`);
|
|
29117
29077
|
renameSync(join(parent, `latest-${buildId}`), join(parent, "latest"));
|
|
29118
29078
|
if (options.json) {
|
|
29119
|
-
|
|
29079
|
+
process14.stdout.write(`${JSON.stringify({
|
|
29120
29080
|
schemaVersion: 1,
|
|
29121
29081
|
artifactDir: output2,
|
|
29122
29082
|
manifestPath: join(output2, "manifest.json"),
|
|
@@ -29140,30 +29100,6 @@ async function buildCommand(options) {
|
|
|
29140
29100
|
rmSync(staging, { recursive: true, force: true });
|
|
29141
29101
|
}
|
|
29142
29102
|
}
|
|
29143
|
-
async function deploySecretsCommand(directory, options) {
|
|
29144
|
-
if (!options.import || !["docker", "podman"].includes(options.runtime ?? "docker"))
|
|
29145
|
-
throw new Error(cliM("cli_deploy_secrets_options"));
|
|
29146
|
-
const cwd = resolve(options.cwd ?? process15.cwd());
|
|
29147
|
-
const local = createRequire(resolve(cwd, "package.json"));
|
|
29148
|
-
let module;
|
|
29149
|
-
try {
|
|
29150
|
-
module = await import(pathToFileURL(local.resolve("@h-ai/deploy")).href);
|
|
29151
|
-
} catch {
|
|
29152
|
-
throw new Error(cliM("cli_deploy_module_missing"));
|
|
29153
|
-
}
|
|
29154
|
-
const result = await module.importDeploymentSecrets({
|
|
29155
|
-
directory: resolve(cwd, directory),
|
|
29156
|
-
inputFile: resolve(cwd, options.import),
|
|
29157
|
-
runtime: options.runtime === "podman" ? "podman" : "docker",
|
|
29158
|
-
dryRun: options.apply !== true
|
|
29159
|
-
});
|
|
29160
|
-
if (!result.success) {
|
|
29161
|
-
const context = result.error.ext;
|
|
29162
|
-
throw new Error(`${result.error.message}
|
|
29163
|
-
${JSON.stringify({ phase: context?.phase, state: context?.state })}`);
|
|
29164
|
-
}
|
|
29165
|
-
writeCliMessage(JSON.stringify(result.data, null, 2));
|
|
29166
|
-
}
|
|
29167
29103
|
var s3FieldPrompts = {
|
|
29168
29104
|
endpoint: "cli_deploy_s3_endpoint",
|
|
29169
29105
|
bucket: "cli_deploy_s3_bucket",
|
|
@@ -29748,14 +29684,14 @@ async function configureDeployHttps(module, config2, environment, nonInteractive
|
|
|
29748
29684
|
}
|
|
29749
29685
|
async function deployCommand(options) {
|
|
29750
29686
|
const spinner = ora();
|
|
29751
|
-
const cwd = options.cwd ??
|
|
29687
|
+
const cwd = options.cwd ?? process14.cwd();
|
|
29752
29688
|
let appDir = resolve(cwd, options.appDir ?? ".");
|
|
29753
29689
|
let closeDeploy = null;
|
|
29754
|
-
|
|
29755
|
-
|
|
29756
|
-
|
|
29757
|
-
const
|
|
29758
|
-
const initialLevel =
|
|
29690
|
+
const originalEnv = { ...process14.env };
|
|
29691
|
+
const originalLogLevels = /* @__PURE__ */ new Map();
|
|
29692
|
+
originalLogLevels.set(core, core.logger.getLevel());
|
|
29693
|
+
const quietSetup = options.plan || !options.yes;
|
|
29694
|
+
const initialLevel = quietSetup ? "fatal" : LogLevelSchema.safeParse(process14.env.HAI_CORE_LOGGING_LEVEL).data;
|
|
29759
29695
|
if (initialLevel)
|
|
29760
29696
|
core.logger.setLevel(initialLevel);
|
|
29761
29697
|
try {
|
|
@@ -29772,7 +29708,7 @@ async function deployCommand(options) {
|
|
|
29772
29708
|
throw new Error(cliM("cli_build_selection_invalid"));
|
|
29773
29709
|
let environmentName = options.env;
|
|
29774
29710
|
if (!environmentName) {
|
|
29775
|
-
if (!
|
|
29711
|
+
if (!process14.stdin.isTTY)
|
|
29776
29712
|
throw new Error(cliM("cli_deploy_environment_hint"));
|
|
29777
29713
|
const answer = await prompts({
|
|
29778
29714
|
type: "text",
|
|
@@ -29784,28 +29720,27 @@ async function deployCommand(options) {
|
|
|
29784
29720
|
if (!environmentName)
|
|
29785
29721
|
throw new Error(cliM("cli_deploy_cancelled"));
|
|
29786
29722
|
}
|
|
29787
|
-
if (!options.plan && !options.yes && !
|
|
29723
|
+
if (!options.plan && !options.yes && !process14.stdin.isTTY)
|
|
29788
29724
|
throw new Error(cliM("cli_deploy_environment_hint"));
|
|
29789
29725
|
let deployModule;
|
|
29790
29726
|
try {
|
|
29791
29727
|
const localRequire = createRequire(resolve(appDir, "package.json"));
|
|
29792
|
-
try {
|
|
29793
|
-
const { core: projectCore } = await import(pathToFileURL(localRequire.resolve("@h-ai/core")).href);
|
|
29794
|
-
if (projectCore !== core) {
|
|
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);
|
|
29800
|
-
}
|
|
29801
|
-
} catch {
|
|
29802
|
-
}
|
|
29803
29728
|
let modulePath;
|
|
29804
29729
|
try {
|
|
29805
29730
|
modulePath = localRequire.resolve("@h-ai/deploy");
|
|
29806
29731
|
} catch {
|
|
29807
29732
|
modulePath = createRequire(import.meta.url).resolve("@h-ai/deploy");
|
|
29808
29733
|
}
|
|
29734
|
+
try {
|
|
29735
|
+
const corePath = createRequire(modulePath).resolve("@h-ai/core");
|
|
29736
|
+
const { core: deployCore } = await import(pathToFileURL(corePath).href);
|
|
29737
|
+
if (!originalLogLevels.has(deployCore)) {
|
|
29738
|
+
originalLogLevels.set(deployCore, deployCore.logger.getLevel());
|
|
29739
|
+
if (initialLevel)
|
|
29740
|
+
deployCore.logger.setLevel(initialLevel);
|
|
29741
|
+
}
|
|
29742
|
+
} catch {
|
|
29743
|
+
}
|
|
29809
29744
|
deployModule = await import(pathToFileURL(modulePath).href);
|
|
29810
29745
|
} catch {
|
|
29811
29746
|
writeCliError(chalk.red(cliM("cli_deploy_module_missing")));
|
|
@@ -29860,7 +29795,7 @@ async function deployCommand(options) {
|
|
|
29860
29795
|
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)
|
|
29861
29796
|
throw new Error(cliM("cli_deploy_plan_options"));
|
|
29862
29797
|
const loaded = deployModule.loadDeploymentConfig("deploy", buildFile, {
|
|
29863
|
-
...
|
|
29798
|
+
...process14.env,
|
|
29864
29799
|
...environment.data.values
|
|
29865
29800
|
});
|
|
29866
29801
|
if (!loaded.success)
|
|
@@ -29888,11 +29823,13 @@ async function deployCommand(options) {
|
|
|
29888
29823
|
writeCliMessage(JSON.stringify(plan.data, null, 2));
|
|
29889
29824
|
return;
|
|
29890
29825
|
}
|
|
29891
|
-
Object.assign(
|
|
29892
|
-
|
|
29893
|
-
|
|
29894
|
-
|
|
29895
|
-
|
|
29826
|
+
Object.assign(process14.env, environment.data.values);
|
|
29827
|
+
if (!quietSetup) {
|
|
29828
|
+
const level = LogLevelSchema.safeParse(process14.env.HAI_CORE_LOGGING_LEVEL).data;
|
|
29829
|
+
if (level) {
|
|
29830
|
+
for (const instance of originalLogLevels.keys())
|
|
29831
|
+
instance.logger.setLevel(level);
|
|
29832
|
+
}
|
|
29896
29833
|
}
|
|
29897
29834
|
spinner.start(cliM("cli_deploy_load_credentials"));
|
|
29898
29835
|
const credResult = deploy.credentials.load();
|
|
@@ -29915,7 +29852,7 @@ async function deployCommand(options) {
|
|
|
29915
29852
|
params: { path: configPath }
|
|
29916
29853
|
}));
|
|
29917
29854
|
}
|
|
29918
|
-
const loadedConfig = deployModule.loadDeploymentConfig("deploy", configPath,
|
|
29855
|
+
const loadedConfig = deployModule.loadDeploymentConfig("deploy", configPath, process14.env);
|
|
29919
29856
|
if (!loadedConfig.success)
|
|
29920
29857
|
throw new Error(loadedConfig.error.message);
|
|
29921
29858
|
const deployConfig = loadedConfig.data;
|
|
@@ -30048,15 +29985,20 @@ async function deployCommand(options) {
|
|
|
30048
29985
|
if (options.bundleOnly)
|
|
30049
29986
|
await configureDeployTarget(deployModule, deployConfig, environment.data, options.yes, true);
|
|
30050
29987
|
await configureDeployHttps(deployModule, deployConfig, environment.data, options.yes, selectedServices !== void 0);
|
|
30051
|
-
for (const key of Object.keys(
|
|
29988
|
+
for (const key of Object.keys(process14.env)) {
|
|
30052
29989
|
if (originalEnv[key] === void 0)
|
|
30053
|
-
delete
|
|
29990
|
+
delete process14.env[key];
|
|
30054
29991
|
}
|
|
30055
|
-
Object.assign(
|
|
29992
|
+
Object.assign(process14.env, originalEnv);
|
|
30056
29993
|
const refreshed = deployModule.loadDeploymentEnvironment({ environment: environment.data.environment, envDir: environment.data.envDir });
|
|
30057
29994
|
if (!refreshed.success)
|
|
30058
29995
|
throw new Error(refreshed.error.message);
|
|
30059
|
-
Object.assign(
|
|
29996
|
+
Object.assign(process14.env, refreshed.data.values);
|
|
29997
|
+
if (quietSetup) {
|
|
29998
|
+
const level = LogLevelSchema.safeParse(process14.env.HAI_CORE_LOGGING_LEVEL).data;
|
|
29999
|
+
for (const [instance, originalLevel] of originalLogLevels)
|
|
30000
|
+
instance.logger.setLevel(level ?? originalLevel);
|
|
30001
|
+
}
|
|
30060
30002
|
spinner.start(cliM("cli_deploy_initializing"));
|
|
30061
30003
|
const validatedConfig = deployModule.DeployConfigSchema.safeParse(deployConfig);
|
|
30062
30004
|
if (!validatedConfig.success) {
|
|
@@ -30164,16 +30106,16 @@ async function deployCommand(options) {
|
|
|
30164
30106
|
await closeDeploy();
|
|
30165
30107
|
} catch (error62) {
|
|
30166
30108
|
writeCliError("Failed to close deploy module", error62);
|
|
30167
|
-
|
|
30109
|
+
process14.exitCode = 1;
|
|
30168
30110
|
}
|
|
30169
30111
|
}
|
|
30170
|
-
for (const key of Object.keys(
|
|
30112
|
+
for (const key of Object.keys(process14.env)) {
|
|
30171
30113
|
if (originalEnv[key] === void 0)
|
|
30172
|
-
delete
|
|
30114
|
+
delete process14.env[key];
|
|
30173
30115
|
}
|
|
30174
|
-
Object.assign(
|
|
30175
|
-
|
|
30176
|
-
|
|
30116
|
+
Object.assign(process14.env, originalEnv);
|
|
30117
|
+
for (const [instance, level] of originalLogLevels)
|
|
30118
|
+
instance.logger.setLevel(level);
|
|
30177
30119
|
}
|
|
30178
30120
|
}
|
|
30179
30121
|
var require2 = createRequire("/");
|
|
@@ -30379,11 +30321,11 @@ var ec = [
|
|
|
30379
30321
|
"invalid zip data"
|
|
30380
30322
|
// determined by unknown compression method
|
|
30381
30323
|
];
|
|
30382
|
-
var
|
|
30324
|
+
var err28 = function(ind, msg, nt) {
|
|
30383
30325
|
var e = new Error(msg || ec[ind]);
|
|
30384
30326
|
e.code = ind;
|
|
30385
30327
|
if (Error.captureStackTrace)
|
|
30386
|
-
Error.captureStackTrace(e,
|
|
30328
|
+
Error.captureStackTrace(e, err28);
|
|
30387
30329
|
if (!nt)
|
|
30388
30330
|
throw e;
|
|
30389
30331
|
return e;
|
|
@@ -30416,7 +30358,7 @@ var inflt = function(dat, st, buf, dict) {
|
|
|
30416
30358
|
var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;
|
|
30417
30359
|
if (t > sl) {
|
|
30418
30360
|
if (noSt)
|
|
30419
|
-
|
|
30361
|
+
err28(0);
|
|
30420
30362
|
break;
|
|
30421
30363
|
}
|
|
30422
30364
|
if (resize)
|
|
@@ -30462,10 +30404,10 @@ var inflt = function(dat, st, buf, dict) {
|
|
|
30462
30404
|
lm = hMap(lt, lbt);
|
|
30463
30405
|
dm = hMap(dt, dbt);
|
|
30464
30406
|
} else
|
|
30465
|
-
|
|
30407
|
+
err28(1);
|
|
30466
30408
|
if (pos > tbts) {
|
|
30467
30409
|
if (noSt)
|
|
30468
|
-
|
|
30410
|
+
err28(0);
|
|
30469
30411
|
break;
|
|
30470
30412
|
}
|
|
30471
30413
|
}
|
|
@@ -30478,11 +30420,11 @@ var inflt = function(dat, st, buf, dict) {
|
|
|
30478
30420
|
pos += c & 15;
|
|
30479
30421
|
if (pos > tbts) {
|
|
30480
30422
|
if (noSt)
|
|
30481
|
-
|
|
30423
|
+
err28(0);
|
|
30482
30424
|
break;
|
|
30483
30425
|
}
|
|
30484
30426
|
if (!c)
|
|
30485
|
-
|
|
30427
|
+
err28(2);
|
|
30486
30428
|
if (sym < 256)
|
|
30487
30429
|
buf[bt++] = sym;
|
|
30488
30430
|
else if (sym == 256) {
|
|
@@ -30497,7 +30439,7 @@ var inflt = function(dat, st, buf, dict) {
|
|
|
30497
30439
|
}
|
|
30498
30440
|
var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
|
|
30499
30441
|
if (!d)
|
|
30500
|
-
|
|
30442
|
+
err28(3);
|
|
30501
30443
|
pos += d & 15;
|
|
30502
30444
|
var dt = fd[dsym];
|
|
30503
30445
|
if (dsym > 3) {
|
|
@@ -30506,7 +30448,7 @@ var inflt = function(dat, st, buf, dict) {
|
|
|
30506
30448
|
}
|
|
30507
30449
|
if (pos > tbts) {
|
|
30508
30450
|
if (noSt)
|
|
30509
|
-
|
|
30451
|
+
err28(0);
|
|
30510
30452
|
break;
|
|
30511
30453
|
}
|
|
30512
30454
|
if (resize)
|
|
@@ -30515,7 +30457,7 @@ var inflt = function(dat, st, buf, dict) {
|
|
|
30515
30457
|
if (bt < dt) {
|
|
30516
30458
|
var shift = dl - dt, dend = Math.min(dt, end);
|
|
30517
30459
|
if (shift + bt < 0)
|
|
30518
|
-
|
|
30460
|
+
err28(3);
|
|
30519
30461
|
for (; bt < dend; ++bt)
|
|
30520
30462
|
buf[bt] = dict[shift + bt];
|
|
30521
30463
|
}
|
|
@@ -30605,7 +30547,7 @@ function strFromU8(dat, latin1) {
|
|
|
30605
30547
|
} else {
|
|
30606
30548
|
var _a4 = dutf8(dat), s = _a4.s, r = _a4.r;
|
|
30607
30549
|
if (r.length)
|
|
30608
|
-
|
|
30550
|
+
err28(8);
|
|
30609
30551
|
return s;
|
|
30610
30552
|
}
|
|
30611
30553
|
}
|
|
@@ -30632,7 +30574,7 @@ var z64hs = function(d, b, l, z2, sc, su, off) {
|
|
|
30632
30574
|
}
|
|
30633
30575
|
}
|
|
30634
30576
|
if (z2 < 2)
|
|
30635
|
-
|
|
30577
|
+
err28(13);
|
|
30636
30578
|
}
|
|
30637
30579
|
return [sc, su, off, 0];
|
|
30638
30580
|
};
|
|
@@ -30641,7 +30583,7 @@ function unzipSync(data, opts) {
|
|
|
30641
30583
|
var e = data.length - 22;
|
|
30642
30584
|
for (; b4(data, e) != 101010256; --e) {
|
|
30643
30585
|
if (!e || data.length - e > 65558)
|
|
30644
|
-
|
|
30586
|
+
err28(13);
|
|
30645
30587
|
}
|
|
30646
30588
|
var c = b2(data, e + 8);
|
|
30647
30589
|
if (!c)
|
|
@@ -30665,7 +30607,7 @@ function unzipSync(data, opts) {
|
|
|
30665
30607
|
else if (c_2 == 8)
|
|
30666
30608
|
files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });
|
|
30667
30609
|
else
|
|
30668
|
-
|
|
30610
|
+
err28(14, "unknown compression type " + c_2);
|
|
30669
30611
|
}
|
|
30670
30612
|
}
|
|
30671
30613
|
return files;
|
|
@@ -31056,11 +30998,11 @@ async function startFeedbackViewer(bundle, options = {}) {
|
|
|
31056
30998
|
response.setHeader("Content-Disposition", "attachment");
|
|
31057
30999
|
response.writeHead(200).end(bytes);
|
|
31058
31000
|
});
|
|
31059
|
-
await new Promise((
|
|
31001
|
+
await new Promise((resolve15, reject) => {
|
|
31060
31002
|
server.once("error", reject);
|
|
31061
31003
|
server.listen(port, "127.0.0.1", () => {
|
|
31062
31004
|
server.removeListener("error", reject);
|
|
31063
|
-
|
|
31005
|
+
resolve15();
|
|
31064
31006
|
});
|
|
31065
31007
|
});
|
|
31066
31008
|
const address = server.address();
|
|
@@ -31068,8 +31010,8 @@ async function startFeedbackViewer(bundle, options = {}) {
|
|
|
31068
31010
|
throw new Error(cliM("cli_feedback_invalidOptions"));
|
|
31069
31011
|
return {
|
|
31070
31012
|
url: `http://127.0.0.1:${address.port}${prefix}viewer/index.html`,
|
|
31071
|
-
close: () => new Promise((
|
|
31072
|
-
server.close((error62) => error62 ? reject(error62) :
|
|
31013
|
+
close: () => new Promise((resolve15, reject) => {
|
|
31014
|
+
server.close((error62) => error62 ? reject(error62) : resolve15());
|
|
31073
31015
|
server.closeAllConnections();
|
|
31074
31016
|
})
|
|
31075
31017
|
};
|
|
@@ -31115,7 +31057,7 @@ async function feedbackCommand(action, bundlePath, options = {}) {
|
|
|
31115
31057
|
].includes(action)) {
|
|
31116
31058
|
throw new Error(cliM("cli_feedback_invalidAction"));
|
|
31117
31059
|
}
|
|
31118
|
-
const filePath = path2.resolve(options.cwd ??
|
|
31060
|
+
const filePath = path2.resolve(options.cwd ?? process14.cwd(), bundlePath);
|
|
31119
31061
|
const result = await readFeedbackBundle(readBundleFile(filePath));
|
|
31120
31062
|
if (!result.success)
|
|
31121
31063
|
throw new Error(result.error.message);
|
|
@@ -31146,14 +31088,14 @@ async function feedbackCommand(action, bundlePath, options = {}) {
|
|
|
31146
31088
|
writeCliMessage(cliM("cli_feedback_viewerStarted", {
|
|
31147
31089
|
params: { url: viewer.url }
|
|
31148
31090
|
}));
|
|
31149
|
-
await new Promise((
|
|
31091
|
+
await new Promise((resolve15, reject) => {
|
|
31150
31092
|
const stop = () => {
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
viewer.close().then(
|
|
31093
|
+
process14.off("SIGINT", stop);
|
|
31094
|
+
process14.off("SIGTERM", stop);
|
|
31095
|
+
viewer.close().then(resolve15, reject);
|
|
31154
31096
|
};
|
|
31155
|
-
|
|
31156
|
-
|
|
31097
|
+
process14.once("SIGINT", stop);
|
|
31098
|
+
process14.once("SIGTERM", stop);
|
|
31157
31099
|
});
|
|
31158
31100
|
}
|
|
31159
31101
|
function appendAt(source, marker, entry) {
|
|
@@ -31880,7 +31822,7 @@ async function initProject(options) {
|
|
|
31880
31822
|
}
|
|
31881
31823
|
}));
|
|
31882
31824
|
if (project.isHaiProject) {
|
|
31883
|
-
const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-
|
|
31825
|
+
const { generateProjectAiSupport, resolveSkillNamesForPackages } = await import('./cli-skill-templates-JKF6E3PI.js');
|
|
31884
31826
|
const generatedFiles = await generateProjectAiSupport(cwd, resolveSkillNamesForPackages(project.haiPackages), {
|
|
31885
31827
|
overwriteSkills: false,
|
|
31886
31828
|
overwriteBridgeFiles: false
|
|
@@ -31975,17 +31917,6 @@ async function initProject(options) {
|
|
|
31975
31917
|
function object3(value) {
|
|
31976
31918
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
31977
31919
|
}
|
|
31978
|
-
function declaresValueExport(source, name) {
|
|
31979
|
-
const declarations = source.replace(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`/g, " ");
|
|
31980
|
-
if (new RegExp(`\\bexport\\s+(?:declare\\s+)?(?:function|const|let|var)\\s+${name}\\b`).test(declarations))
|
|
31981
|
-
return true;
|
|
31982
|
-
return [
|
|
31983
|
-
...declarations.matchAll(/\bexport\s*\{([^}]+)\}/g)
|
|
31984
|
-
].some((match) => match[1].split(",").some((item) => {
|
|
31985
|
-
const value = item.trim();
|
|
31986
|
-
return !value.startsWith("type ") && value.split(/\s+as\s+/).at(-1)?.trim() === name;
|
|
31987
|
-
}));
|
|
31988
|
-
}
|
|
31989
31920
|
function tarFiles(bytes) {
|
|
31990
31921
|
const tar = gunzipSync(bytes, { maxOutputLength: 64 * 1024 * 1024 });
|
|
31991
31922
|
const files = /* @__PURE__ */ new Map();
|
|
@@ -32020,7 +31951,7 @@ async function inspectFrameworkUpgrade(directory, version2) {
|
|
|
32020
31951
|
for await (const manifest of glob(`${pattern}/package.json`, { cwd: root, exclude })) {
|
|
32021
31952
|
const location = realpathSync(dirname(join(root, manifest)));
|
|
32022
31953
|
const fromRoot = relative(root, location);
|
|
32023
|
-
if (!isAbsolute(fromRoot) && fromRoot !== ".." && !fromRoot.startsWith(`..${
|
|
31954
|
+
if (!isAbsolute(fromRoot) && fromRoot !== ".." && !fromRoot.startsWith(`..${process14.platform === "win32" ? "\\" : "/"}`)) {
|
|
32024
31955
|
directories.add(location);
|
|
32025
31956
|
}
|
|
32026
31957
|
}
|
|
@@ -32082,11 +32013,10 @@ async function inspectFrameworkUpgrade(directory, version2) {
|
|
|
32082
32013
|
});
|
|
32083
32014
|
}
|
|
32084
32015
|
}
|
|
32085
|
-
const registry2 = new URL(
|
|
32016
|
+
const registry2 = new URL(process14.env.npm_config_registry ?? "https://registry.npmjs.org/");
|
|
32086
32017
|
if (registry2.username || registry2.password || registry2.protocol !== "https:")
|
|
32087
32018
|
throw new Error(cliM("cli_upgrade_registry"));
|
|
32088
32019
|
const releases = [];
|
|
32089
|
-
const migrationPreflight = [];
|
|
32090
32020
|
const skills = [];
|
|
32091
32021
|
const pending = [...packages];
|
|
32092
32022
|
for (let index = 0; index < pending.length; index++) {
|
|
@@ -32141,14 +32071,6 @@ async function inspectFrameworkUpgrade(directory, version2) {
|
|
|
32141
32071
|
const manifest = files.get("package/package.json");
|
|
32142
32072
|
if (!manifest || object3(JSON.parse(new TextDecoder().decode(manifest))).version !== version2 || !files.has("package/dist/index.js"))
|
|
32143
32073
|
throw new Error("Incomplete artifact");
|
|
32144
|
-
const migration = {
|
|
32145
|
-
"@h-ai/iam": "migrateIam",
|
|
32146
|
-
"@h-ai/reach": "migrateReach",
|
|
32147
|
-
"@h-ai/scheduler": "migrateScheduler",
|
|
32148
|
-
"@h-ai/audit": "migrateAudit"
|
|
32149
|
-
}[name];
|
|
32150
|
-
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))
|
|
32151
|
-
migrationPreflight.push(`${migration}({ dryRun: true })`);
|
|
32152
32074
|
if (name === "@h-ai/cli") {
|
|
32153
32075
|
if (!files.has("package/templates/skills/hai-feedback/SKILL.md"))
|
|
32154
32076
|
throw new Error("Skills missing");
|
|
@@ -32201,22 +32123,14 @@ async function inspectFrameworkUpgrade(directory, version2) {
|
|
|
32201
32123
|
...Object.keys(object3(object3(rootManifest.pnpm).patchedDependencies))
|
|
32202
32124
|
])
|
|
32203
32125
|
]
|
|
32204
|
-
},
|
|
32205
|
-
migration: {
|
|
32206
|
-
preflight: migrationPreflight,
|
|
32207
|
-
inspectModuleReadmes: true,
|
|
32208
|
-
exclusiveAccess: true,
|
|
32209
|
-
backup: ["database", "shared-session-cache"],
|
|
32210
|
-
rollback: "restore-compatible-database-and-binaries",
|
|
32211
|
-
sessions: "legacy-credential-sessions-require-login"
|
|
32212
32126
|
}
|
|
32213
32127
|
};
|
|
32214
32128
|
}
|
|
32215
32129
|
async function upgradeCommand(version2, options = {}) {
|
|
32216
|
-
const report = await inspectFrameworkUpgrade(options.cwd ??
|
|
32130
|
+
const report = await inspectFrameworkUpgrade(options.cwd ?? process14.cwd(), version2);
|
|
32217
32131
|
writeCliMessage(JSON.stringify(report, null, 2));
|
|
32218
32132
|
if (!report.releaseComplete)
|
|
32219
|
-
|
|
32133
|
+
process14.exitCode = 1;
|
|
32220
32134
|
}
|
|
32221
32135
|
|
|
32222
32136
|
// src/cli-main.ts
|
|
@@ -32241,7 +32155,7 @@ cli.command("create [name]", cliM("cli_help_create")).option("--type <type>", cl
|
|
|
32241
32155
|
cwd: options.cwd
|
|
32242
32156
|
});
|
|
32243
32157
|
} catch {
|
|
32244
|
-
|
|
32158
|
+
process14.exitCode = 1;
|
|
32245
32159
|
}
|
|
32246
32160
|
});
|
|
32247
32161
|
cli.command("add [module]", cliM("cli_help_add")).option("--no-install", cliM("cli_help_noInstall")).action(async (module, options) => {
|
|
@@ -32253,7 +32167,7 @@ cli.command("add [module]", cliM("cli_help_add")).option("--no-install", cliM("c
|
|
|
32253
32167
|
cwd: options.cwd
|
|
32254
32168
|
});
|
|
32255
32169
|
} catch {
|
|
32256
|
-
|
|
32170
|
+
process14.exit(1);
|
|
32257
32171
|
}
|
|
32258
32172
|
});
|
|
32259
32173
|
cli.command("init", cliM("cli_help_init")).option("-f, --force", cliM("cli_help_forceConfig")).action(async (options) => {
|
|
@@ -32264,7 +32178,7 @@ cli.command("init", cliM("cli_help_init")).option("-f, --force", cliM("cli_help_
|
|
|
32264
32178
|
cwd: options.cwd
|
|
32265
32179
|
});
|
|
32266
32180
|
} catch {
|
|
32267
|
-
|
|
32181
|
+
process14.exit(1);
|
|
32268
32182
|
}
|
|
32269
32183
|
});
|
|
32270
32184
|
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) => {
|
|
@@ -32281,7 +32195,7 @@ cli.command("generate [type] [name]", cliM("cli_help_generate")).option("-w, --w
|
|
|
32281
32195
|
cwd: options.cwd
|
|
32282
32196
|
});
|
|
32283
32197
|
} catch {
|
|
32284
|
-
|
|
32198
|
+
process14.exit(1);
|
|
32285
32199
|
}
|
|
32286
32200
|
});
|
|
32287
32201
|
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) => {
|
|
@@ -32293,7 +32207,7 @@ cli.command("build", cliM("cli_help_build")).option("--target <target>", cliM("c
|
|
|
32293
32207
|
writeCliError(message);
|
|
32294
32208
|
else
|
|
32295
32209
|
writeCliMessage(message);
|
|
32296
|
-
|
|
32210
|
+
process14.exitCode = 1;
|
|
32297
32211
|
}
|
|
32298
32212
|
});
|
|
32299
32213
|
cli.command("upgrade <version>", cliM("cli_help_upgrade")).action(async (version2, options) => {
|
|
@@ -32301,7 +32215,7 @@ cli.command("upgrade <version>", cliM("cli_help_upgrade")).action(async (version
|
|
|
32301
32215
|
await upgradeCommand(version2, options);
|
|
32302
32216
|
} catch (error62) {
|
|
32303
32217
|
writeCliMessage(error62 instanceof Error ? error62.message : String(error62));
|
|
32304
|
-
|
|
32218
|
+
process14.exitCode = 1;
|
|
32305
32219
|
}
|
|
32306
32220
|
});
|
|
32307
32221
|
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) => {
|
|
@@ -32334,15 +32248,7 @@ cli.command("deploy [appDir]", cliM("cli_help_deploy")).option("--plan", cliM("c
|
|
|
32334
32248
|
cwd: options.cwd
|
|
32335
32249
|
});
|
|
32336
32250
|
} catch {
|
|
32337
|
-
|
|
32338
|
-
}
|
|
32339
|
-
});
|
|
32340
|
-
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) => {
|
|
32341
|
-
try {
|
|
32342
|
-
await deploySecretsCommand(directory, options);
|
|
32343
|
-
} catch (error62) {
|
|
32344
|
-
writeCliMessage(error62 instanceof Error ? error62.message : String(error62));
|
|
32345
|
-
process15.exitCode = 1;
|
|
32251
|
+
process14.exitCode = 1;
|
|
32346
32252
|
}
|
|
32347
32253
|
});
|
|
32348
32254
|
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) => {
|
|
@@ -32361,7 +32267,7 @@ cli.command("feedback <action> <bundle>", cliM("cli_help_feedback")).option("--p
|
|
|
32361
32267
|
});
|
|
32362
32268
|
} catch (error62) {
|
|
32363
32269
|
writeCliMessage(error62 instanceof Error ? error62.message : String(error62));
|
|
32364
|
-
|
|
32270
|
+
process14.exitCode = 1;
|
|
32365
32271
|
}
|
|
32366
32272
|
});
|
|
32367
32273
|
cli.command("g:page <name>", cliM("cli_help_generatePage")).option("-w, --workspace <name>", cliM("cli_help_workspace")).action(async (name, options) => {
|