@heybox/hb-sdk 0.9.6-alpha.10 → 0.9.6-alpha.13
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/CHANGELOG.md +32 -0
- package/README.md +8 -1
- package/dist/cli-chunks/{artifact-BaZzEQjq.cjs → artifact-CUNeWo4O.cjs} +6 -5
- package/dist/cli-chunks/{build-Ykhw1sz9.cjs → build-BnUonzjX.cjs} +6 -5
- package/dist/cli-chunks/{create-BEjKsD1y.cjs → create-BbpSkT6L.cjs} +322 -4
- package/dist/cli-chunks/{dev-DpkBN4ir.cjs → dev-Bj4ll4KS.cjs} +16 -15
- package/dist/cli-chunks/{dev-context-B3Y_EcXC.cjs → dev-context-zGJh3bl_.cjs} +22 -14
- package/dist/cli-chunks/{doctor-DPELjB83.cjs → doctor-CJm6yLwg.cjs} +1 -1
- package/dist/cli-chunks/{games-D2hnnWKY.cjs → games-M21dEyxU.cjs} +1 -1
- package/dist/cli-chunks/{index-DIgSsTuu.cjs → index-C29Bsipw.cjs} +73 -20
- package/dist/cli-chunks/{index-DCj9vtVv.cjs → index-DOEadJGe.cjs} +1 -1
- package/dist/cli-chunks/{index.esm-t29GC7yg.cjs → index.esm-BDnn3rPW.cjs} +7 -6
- package/dist/cli-chunks/index.esm-CvMA_ppV.cjs +7977 -0
- package/dist/cli-chunks/{login-C5XmcbRa.cjs → login-sznH9Tub.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-B12EMgRq.cjs → project-vite-C3XGMxuI.cjs} +1 -1
- package/dist/cli-chunks/{remote-lFAA88Zl.cjs → remote-ZN1aTL2_.cjs} +13 -8
- package/dist/cli-chunks/{runtime-permission-env-CYbLBtWo.cjs → runtime-permission-env-CubbhSAi.cjs} +52 -6990
- package/dist/cli-chunks/{skill-AilHsggi.cjs → skill-MQLZiQHF.cjs} +2 -2
- package/dist/cli-chunks/{version-KZTUyIiC.cjs → version-d8xCNdNj.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-OjGtNPTW.js +228 -0
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-Dmzm0ERX.js +6 -0
- package/dist/devtools/browser-dev-host/assets/index-BkmmmW8K.css +1 -0
- package/dist/devtools/browser-dev-host/assets/index-Dp6vGvaS.js +586 -0
- package/dist/devtools/browser-dev-host/index.html +3 -3
- package/dist/index.cjs.js +1201 -156
- package/dist/index.esm.js +1201 -156
- package/dist/miniapp-publish.cjs.js +1072 -131
- package/dist/miniapp-publish.esm.js +1072 -131
- package/dist/protocol.cjs.js +732 -158
- package/dist/protocol.esm.js +716 -159
- package/dist/templates/vanilla-vite-js/README.md.ejs +27 -0
- package/dist/templates/vanilla-vite-js/package.json.ejs +1 -1
- package/dist/templates/vanilla-vite-js/src/user-game-data.js.ejs +1 -0
- package/dist/vite.cjs.js +1074 -133
- package/dist/vite.esm.js +1074 -133
- package/package.json +6 -6
- package/skill/SKILL.md +4 -0
- package/skill/skill.json +5 -5
- package/types/index.d.ts +439 -9
- package/types/miniapp-publish/index.d.ts +18 -2
- package/types/protocol.d.ts +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-C0_lx52X.js +0 -100
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-CPk4dD63.js +0 -6
- package/dist/devtools/browser-dev-host/assets/index-BzOC7Q8l.js +0 -586
- package/dist/devtools/browser-dev-host/assets/index-CHYEXFEg.css +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var runtimePermissionEnv = require('./runtime-permission-env-
|
|
3
|
+
var index = require('./index-C29Bsipw.cjs');
|
|
4
|
+
var runtimePermissionEnv = require('./runtime-permission-env-CubbhSAi.cjs');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
6
|
var fs = require('node:fs/promises');
|
|
7
7
|
var path = require('node:path');
|
|
8
8
|
var fs$1 = require('node:fs');
|
|
9
9
|
var sharp = require('sharp');
|
|
10
|
+
var index_esm = require('./index.esm-CvMA_ppV.cjs');
|
|
10
11
|
|
|
11
12
|
function createRemoteApiClient(options) {
|
|
12
13
|
return {
|
|
@@ -544,7 +545,7 @@ async function compareBasicInfo(cwd, detail, fetchImpl = fetch) {
|
|
|
544
545
|
function resolveBrowserFakeContext(context, now = Date.now()) {
|
|
545
546
|
if (context.localDevGrant === undefined)
|
|
546
547
|
return context;
|
|
547
|
-
const parsed =
|
|
548
|
+
const parsed = index_esm.parseMiniProgramLocalDevGrant(context.localDevGrant);
|
|
548
549
|
if (!parsed.valid ||
|
|
549
550
|
!context.devSessionId?.trim() ||
|
|
550
551
|
!Number.isSafeInteger(context.contextRevision) ||
|
|
@@ -557,7 +558,7 @@ function resolveBrowserFakeContext(context, now = Date.now()) {
|
|
|
557
558
|
return {
|
|
558
559
|
...context,
|
|
559
560
|
...(context.expiresAt <= now ? { source: 'anonymous', localDevLaunchToken: undefined, expiresAt: now + 30_000 } : {}),
|
|
560
|
-
localDevGrant:
|
|
561
|
+
localDevGrant: index_esm.createMiniProgramLocalDevGrant({
|
|
561
562
|
declaredPermissions: context.declaredPermissions ?? {},
|
|
562
563
|
runtimePermissions: context.runtimePermissions,
|
|
563
564
|
revision: parsed.grant.revision,
|
|
@@ -577,8 +578,8 @@ const DEFAULT_PERMISSION_STATE = {
|
|
|
577
578
|
},
|
|
578
579
|
};
|
|
579
580
|
function createBrowserDevPermissionState(context) {
|
|
580
|
-
const parsed =
|
|
581
|
-
?
|
|
581
|
+
const parsed = index_esm.parseMiniProgramRuntimePermissions(context.localDevGrant
|
|
582
|
+
? index_esm.composeLocalDevRuntimePermissions({ declaredPermissions: context.declaredPermissions ?? {}, runtimePermissions: context.runtimePermissions,
|
|
582
583
|
localDevGrant: context.localDevGrant }).runtimePermissions
|
|
583
584
|
: context.runtimePermissions);
|
|
584
585
|
const networkRequest = parsed.permissions.network;
|
|
@@ -601,7 +602,7 @@ function createMobileDevSessionRuntimePermissions(context) {
|
|
|
601
602
|
const state = createBrowserDevPermissionState(context);
|
|
602
603
|
return createDevRuntimePermissions(context.runtimePermissions, state, state.networkRequest.useOfficialDomain);
|
|
603
604
|
}
|
|
604
|
-
return
|
|
605
|
+
return index_esm.composeLocalDevRuntimePermissions({ declaredPermissions: context.declaredPermissions, runtimePermissions: context.runtimePermissions }).runtimePermissions;
|
|
605
606
|
}
|
|
606
607
|
function cloneDefaultPermissionState() {
|
|
607
608
|
return {
|
|
@@ -609,12 +610,12 @@ function cloneDefaultPermissionState() {
|
|
|
609
610
|
};
|
|
610
611
|
}
|
|
611
612
|
function createDevRuntimePermissions(snapshot, state, useOfficialDomain) {
|
|
612
|
-
const parsed =
|
|
613
|
+
const parsed = index_esm.parseMiniProgramRuntimePermissions(snapshot);
|
|
613
614
|
if (!parsed.valid) {
|
|
614
615
|
return { schema_version: 1, entries: [] };
|
|
615
616
|
}
|
|
616
617
|
const entries = [];
|
|
617
|
-
for (const key of
|
|
618
|
+
for (const key of index_esm.MINI_PROGRAM_PERMISSION_KEYS) {
|
|
618
619
|
const entry = parsed.permissions[key];
|
|
619
620
|
if (!entry)
|
|
620
621
|
continue;
|
|
@@ -624,11 +625,18 @@ function createDevRuntimePermissions(snapshot, state, useOfficialDomain) {
|
|
|
624
625
|
status: state.networkRequest.status,
|
|
625
626
|
config: { useOfficialDomain },
|
|
626
627
|
}
|
|
627
|
-
:
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
628
|
+
: key === 'user_game_data'
|
|
629
|
+
? {
|
|
630
|
+
key,
|
|
631
|
+
status: entry.status,
|
|
632
|
+
// 精确资源清单是 snapshot 的合法必需项:浏览器模拟只调整开关,不能丢掉 Manifest 声明。
|
|
633
|
+
config: { resources: entry.config.resources },
|
|
634
|
+
}
|
|
635
|
+
: {
|
|
636
|
+
key,
|
|
637
|
+
status: entry.status,
|
|
638
|
+
config: {},
|
|
639
|
+
});
|
|
632
640
|
}
|
|
633
641
|
const revision = isPlainRecord(snapshot) && typeof snapshot.revision === 'number' && Number.isInteger(snapshot.revision) && snapshot.revision >= 0
|
|
634
642
|
? snapshot.revision
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var node_crypto = require('node:crypto');
|
|
4
4
|
var fs = require('node:fs/promises');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-C29Bsipw.cjs');
|
|
7
7
|
require('node:module');
|
|
8
8
|
require('readline');
|
|
9
9
|
require('os');
|
|
@@ -242,19 +242,19 @@ function requireArgument () {
|
|
|
242
242
|
|
|
243
243
|
var command = {};
|
|
244
244
|
|
|
245
|
-
const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
245
|
+
const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-C29Bsipw.cjs', document.baseURI).href)));
|
|
246
246
|
function __require$4() { return require$5("node:events"); }
|
|
247
247
|
|
|
248
|
-
const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
248
|
+
const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-C29Bsipw.cjs', document.baseURI).href)));
|
|
249
249
|
function __require$3() { return require$4("node:child_process"); }
|
|
250
250
|
|
|
251
|
-
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
251
|
+
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-C29Bsipw.cjs', document.baseURI).href)));
|
|
252
252
|
function __require$2() { return require$3("node:path"); }
|
|
253
253
|
|
|
254
|
-
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
254
|
+
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-C29Bsipw.cjs', document.baseURI).href)));
|
|
255
255
|
function __require$1() { return require$2("node:fs"); }
|
|
256
256
|
|
|
257
|
-
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
257
|
+
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-C29Bsipw.cjs', document.baseURI).href)));
|
|
258
258
|
function __require() { return require$1("node:process"); }
|
|
259
259
|
|
|
260
260
|
var help = {};
|
|
@@ -17253,7 +17253,7 @@ async function inspectFeedbackLog(file, size) {
|
|
|
17253
17253
|
return { mimeType: 'text/plain', width: 0, height: 0 };
|
|
17254
17254
|
}
|
|
17255
17255
|
async function createFeedbackCosClient(getToken) {
|
|
17256
|
-
const { default: COS } = await Promise.resolve().then(function () { return require('./index-
|
|
17256
|
+
const { default: COS } = await Promise.resolve().then(function () { return require('./index-DOEadJGe.cjs'); }).then(function (n) { return n.index; });
|
|
17257
17257
|
const cos = new COS({
|
|
17258
17258
|
getAuthorization(_options, callback) {
|
|
17259
17259
|
void getToken().then((token) => callback({
|
|
@@ -21935,7 +21935,7 @@ function installDevPreviewCommands(dev) {
|
|
|
21935
21935
|
}
|
|
21936
21936
|
|
|
21937
21937
|
const CLI_VERSION_PLACEHOLDER = ['__HB', 'SDK', 'CLI', 'VERSION__'].join('_');
|
|
21938
|
-
const BUILT_CLI_VERSION = '0.9.6-alpha.
|
|
21938
|
+
const BUILT_CLI_VERSION = '0.9.6-alpha.13';
|
|
21939
21939
|
const PACKAGE_JSON_CANDIDATES$1 = [
|
|
21940
21940
|
path.resolve(__dirname, '..', '..', 'package.json'),
|
|
21941
21941
|
path.resolve(__dirname, '..', 'package.json'),
|
|
@@ -23013,9 +23013,22 @@ function createCliProgram(overrides = {}) {
|
|
|
23013
23013
|
// 公告获取或展示失败不能阻断命令;交互环境判断由展示模块统一执行。
|
|
23014
23014
|
}
|
|
23015
23015
|
});
|
|
23016
|
-
addVerboseOption(program
|
|
23016
|
+
addVerboseOption(program
|
|
23017
|
+
.command('create')
|
|
23018
|
+
.description('创建外部小程序项目开发模板')
|
|
23019
|
+
.argument('<project-name>', '项目目录名,例如 my-miniapp')
|
|
23020
|
+
.option('--game <game>', '声明游戏资料的游戏,可重复或逗号分隔:ark、black_myth_wukong、task_bar_hero、phantom_blade_zero', collectRepeatableOption, [])
|
|
23021
|
+
.option('--features <features>', '该游戏的功能,可重复或逗号分隔:profile、gacha、save_analysis、save_files', collectRepeatableOption, [])
|
|
23022
|
+
.option('--resources <resourceKey>', '精确资源 key,可重复或逗号分隔;不接受通配符或前缀', collectRepeatableOption, [])
|
|
23023
|
+
.option('--purpose <purpose>', '所选游戏资料的实际用途,必填 1~30 个 Unicode 码点')).action(withUpdateReminder(async (projectName, options, command) => {
|
|
23017
23024
|
const logger = resolveLogger(command);
|
|
23018
|
-
await handlers.runCreateCommand(projectName, {
|
|
23025
|
+
await handlers.runCreateCommand(projectName, {
|
|
23026
|
+
features: readStringListOption(options.features),
|
|
23027
|
+
games: readStringListOption(options.game),
|
|
23028
|
+
logger,
|
|
23029
|
+
resources: readStringListOption(options.resources),
|
|
23030
|
+
purpose: options.purpose,
|
|
23031
|
+
});
|
|
23019
23032
|
}, handlers.printUpdateReminder, resolveLogger));
|
|
23020
23033
|
addVerboseOption(program
|
|
23021
23034
|
.command('dev')
|
|
@@ -23026,8 +23039,12 @@ function createCliProgram(overrides = {}) {
|
|
|
23026
23039
|
.option('--browser-dev-host-port <port>', '浏览器调试页服务端口', parsePositivePort)
|
|
23027
23040
|
.option('--no-open', '不自动打开浏览器调试页')
|
|
23028
23041
|
.option('--no-hmr', '关闭热更新,默认遵循项目的 Vite 配置')
|
|
23042
|
+
.option('--service-tag <tag>', '给 Heybox 后台请求附加 x-rylai-service-tag,默认读取 HB_SDK_SERVICE_TAG')
|
|
23029
23043
|
.helpOption('-h, --help', '显示命令帮助')).action(withUpdateReminder(async (options, command) => {
|
|
23030
23044
|
const logger = resolveLogger(command);
|
|
23045
|
+
// dev 需要与 remote 相同的小程序后台 tag 路由:读取远端权限、签发本地调试凭证都走
|
|
23046
|
+
// /mall/developer/user_miniprogram/ 前缀。没传时沿用 HB_SDK_SERVICE_TAG。
|
|
23047
|
+
applyDevServiceTag(options?.serviceTag);
|
|
23031
23048
|
await handlers.runDevCommand(options, { logger });
|
|
23032
23049
|
}, handlers.printUpdateReminder, resolveLogger));
|
|
23033
23050
|
installDevToolCommands(program.commands.find(command => command.name() === 'dev'));
|
|
@@ -23150,7 +23167,7 @@ function installRemoteCommands(program, handlers, resolveLogger) {
|
|
|
23150
23167
|
const permission = addRemotePublicOptions(remote.command('permission').description('申请平台权限并查看审核状态'));
|
|
23151
23168
|
addRemotePublicOptions(permission.command('list').description('查看平台权限及最近申请状态')).action(createRemoteAction(handlers, resolveLogger, 'permission:list'));
|
|
23152
23169
|
addRemotePublicOptions(permission.command('apply').description('提交平台权限申请')
|
|
23153
|
-
.argument('<key>', 'network、companion 或 appProtocol')
|
|
23170
|
+
.argument('<key>', 'network、companion 或 appProtocol;user_game_data 是声明型权限,无需申请')
|
|
23154
23171
|
.requiredOption('--reason <text>', '申请理由,不超过 500 字')
|
|
23155
23172
|
.option('--domains <domains>', 'network 访问域名,多个用逗号分隔')).action(createRemoteAction(handlers, resolveLogger, 'permission:apply', (command, key) => {
|
|
23156
23173
|
const options = readCommandOptionsWithAncestors(command);
|
|
@@ -23287,6 +23304,16 @@ function pickOptions(command, keys) {
|
|
|
23287
23304
|
function readStringOption(value) {
|
|
23288
23305
|
return typeof value === 'string' ? value : undefined;
|
|
23289
23306
|
}
|
|
23307
|
+
/** 收集可重复选项;重复出现时按出现顺序累加,逗号拆分交给 create 的声明校验统一处理。 */
|
|
23308
|
+
function collectRepeatableOption(value, previous) {
|
|
23309
|
+
return [...previous, value];
|
|
23310
|
+
}
|
|
23311
|
+
function readStringListOption(value) {
|
|
23312
|
+
if (!Array.isArray(value))
|
|
23313
|
+
return undefined;
|
|
23314
|
+
const items = value.filter((item) => typeof item === 'string');
|
|
23315
|
+
return items.length > 0 ? items : undefined;
|
|
23316
|
+
}
|
|
23290
23317
|
function readStringArgument(value, name) {
|
|
23291
23318
|
if (typeof value !== 'string') {
|
|
23292
23319
|
throw new Error(`无法解析 ${name} 参数`);
|
|
@@ -23319,39 +23346,39 @@ function createCommandLoggerResolver(options) {
|
|
|
23319
23346
|
};
|
|
23320
23347
|
}
|
|
23321
23348
|
const defaultClearLoginStatus = async (...args) => {
|
|
23322
|
-
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
23349
|
+
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-sznH9Tub.cjs'); });
|
|
23323
23350
|
return clearLoginStatus(...args);
|
|
23324
23351
|
};
|
|
23325
23352
|
const defaultLoginToHeybox = async (...args) => {
|
|
23326
|
-
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-
|
|
23353
|
+
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-sznH9Tub.cjs'); });
|
|
23327
23354
|
return loginToHeybox(...args);
|
|
23328
23355
|
};
|
|
23329
23356
|
const defaultPrintLoginStatus = async (...args) => {
|
|
23330
|
-
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
23357
|
+
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-sznH9Tub.cjs'); });
|
|
23331
23358
|
return printLoginStatus(...args);
|
|
23332
23359
|
};
|
|
23333
23360
|
const defaultRunBuildCommand = async (...args) => {
|
|
23334
|
-
const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-
|
|
23361
|
+
const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-BnUonzjX.cjs'); });
|
|
23335
23362
|
return runBuildCommand(...args);
|
|
23336
23363
|
};
|
|
23337
23364
|
const defaultRunCreateCommand = async (...args) => {
|
|
23338
|
-
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-
|
|
23365
|
+
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-BbpSkT6L.cjs'); });
|
|
23339
23366
|
return runCreateCommand(...args);
|
|
23340
23367
|
};
|
|
23341
23368
|
const defaultRunDevCommand = async (...args) => {
|
|
23342
|
-
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-
|
|
23369
|
+
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-Bj4ll4KS.cjs'); }).then(function (n) { return n.dev; });
|
|
23343
23370
|
return runDevCommand(...args);
|
|
23344
23371
|
};
|
|
23345
23372
|
const defaultRunDoctorCommand = async (...args) => {
|
|
23346
|
-
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-
|
|
23373
|
+
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-CJm6yLwg.cjs'); });
|
|
23347
23374
|
return runDoctorCommand(...args);
|
|
23348
23375
|
};
|
|
23349
23376
|
const defaultRunSkillInstallCommand = async (...args) => {
|
|
23350
|
-
const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-
|
|
23377
|
+
const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-MQLZiQHF.cjs'); });
|
|
23351
23378
|
return runSkillInstallCommand(...args);
|
|
23352
23379
|
};
|
|
23353
23380
|
const defaultRunRemoteCommand = async (...args) => {
|
|
23354
|
-
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-
|
|
23381
|
+
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-ZN1aTL2_.cjs'); });
|
|
23355
23382
|
return runRemoteCommand(...args);
|
|
23356
23383
|
};
|
|
23357
23384
|
function resolveStandaloneLogger(options, verbose) {
|
|
@@ -23424,6 +23451,9 @@ function readCommandFromActionArgs(args) {
|
|
|
23424
23451
|
*/
|
|
23425
23452
|
function preloadCliEnvPreset(argv, options = {}) {
|
|
23426
23453
|
const result = loadEnvPreset(argv);
|
|
23454
|
+
// HB_SDK_SERVICE_TAG 可能在 --env 预设之外单独设置;它必须对 dev/remote 等命令生效,
|
|
23455
|
+
// 因此先应用,再在缺少预设文件时提前返回。
|
|
23456
|
+
applyServiceTagIfNeeded(process.env.HB_SDK_SERVICE_TAG);
|
|
23427
23457
|
if (!result.filePath) {
|
|
23428
23458
|
return;
|
|
23429
23459
|
}
|
|
@@ -23436,6 +23466,29 @@ function preloadCliEnvPreset(argv, options = {}) {
|
|
|
23436
23466
|
}
|
|
23437
23467
|
applyServiceTagIfNeeded(process.env.HB_SDK_SERVICE_TAG);
|
|
23438
23468
|
}
|
|
23469
|
+
/**
|
|
23470
|
+
* `hb-sdk dev` 的 service tag 路由。
|
|
23471
|
+
*
|
|
23472
|
+
* @remarks
|
|
23473
|
+
* 小程序后台(`/mall/developer/user_miniprogram/`)使用 special_tag,仅对该前缀附加
|
|
23474
|
+
* `x-rylai-service-tag`;同时设置全局 default_tag,便于把公开接口也定向到同 tag 实例。
|
|
23475
|
+
* 未传 tag 时不改动已有配置(可能来自 `HB_SDK_SERVICE_TAG`)。
|
|
23476
|
+
*/
|
|
23477
|
+
function applyDevServiceTag(tag) {
|
|
23478
|
+
if (typeof tag !== 'string' || !tag.trim())
|
|
23479
|
+
return;
|
|
23480
|
+
const normalized = tag.trim();
|
|
23481
|
+
if (/[\r\n]/.test(normalized))
|
|
23482
|
+
throw new Error('x-rylai-service-tag 不允许包含换行符');
|
|
23483
|
+
// 一次写入:两个 apply 辅助函数会互相覆盖(各自只设置自己的字段),dev 需要同时设置。
|
|
23484
|
+
configureHeyboxCliRequestConfig({
|
|
23485
|
+
default_tag: normalized,
|
|
23486
|
+
special_tag: {
|
|
23487
|
+
tag_name: normalized,
|
|
23488
|
+
path_prefix_list: ['/mall/developer/user_miniprogram/'],
|
|
23489
|
+
},
|
|
23490
|
+
});
|
|
23491
|
+
}
|
|
23439
23492
|
function parsePositivePort(value) {
|
|
23440
23493
|
const parsed = Number(value);
|
|
23441
23494
|
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
@@ -23451,7 +23504,7 @@ function parseNonNegativeInteger(value) {
|
|
|
23451
23504
|
return parsed;
|
|
23452
23505
|
}
|
|
23453
23506
|
const defaultRunGameSearchCommand = async (...args) => {
|
|
23454
|
-
const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-
|
|
23507
|
+
const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-M21dEyxU.cjs'); });
|
|
23455
23508
|
return runGameSearchCommand(...args);
|
|
23456
23509
|
};
|
|
23457
23510
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dev = require('./dev-
|
|
4
|
-
require('./index-
|
|
3
|
+
var dev = require('./dev-Bj4ll4KS.cjs');
|
|
4
|
+
require('./index-C29Bsipw.cjs');
|
|
5
5
|
require('node:module');
|
|
6
6
|
require('readline');
|
|
7
7
|
require('os');
|
|
@@ -23,10 +23,11 @@ require('node:child_process');
|
|
|
23
23
|
require('node:util');
|
|
24
24
|
require('node:readline/promises');
|
|
25
25
|
require('node:timers/promises');
|
|
26
|
-
require('./
|
|
27
|
-
require('./version-
|
|
26
|
+
require('./index.esm-CvMA_ppV.cjs');
|
|
27
|
+
require('./version-d8xCNdNj.cjs');
|
|
28
|
+
require('./runtime-permission-env-CubbhSAi.cjs');
|
|
28
29
|
require('node:async_hooks');
|
|
29
|
-
require('./dev-context-
|
|
30
|
+
require('./dev-context-zGJh3bl_.cjs');
|
|
30
31
|
require('sharp');
|
|
31
32
|
require('node:os');
|
|
32
33
|
require('node:net');
|
|
@@ -45,7 +46,7 @@ require('net');
|
|
|
45
46
|
require('tls');
|
|
46
47
|
require('url');
|
|
47
48
|
require('zlib');
|
|
48
|
-
require('./project-vite-
|
|
49
|
+
require('./project-vite-C3XGMxuI.cjs');
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* @packageDocumentation
|