@heybox/hb-sdk 0.8.0-alpha → 0.8.0-alpha.10
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 +92 -396
- package/README.md +101 -24
- package/THIRD_PARTY_NOTICES.md +1755 -0
- package/dist/cli-chunks/{build-DJWFSM1B.cjs → build-aDJbiFqF.cjs} +8 -5
- package/dist/cli-chunks/{context-DV2UK1Nz.cjs → context-Dp36pZ9a.cjs} +39 -81
- package/dist/cli-chunks/{create-2HfoB48V.cjs → create-P3g0ricz.cjs} +2 -2
- package/dist/cli-chunks/{dev-Dgt2zS9k.cjs → dev-CisJkXuQ.cjs} +396 -576
- package/dist/cli-chunks/doctor-B-LF5-uj.cjs +65 -0
- package/dist/cli-chunks/{index-D62ANeBv.cjs → index-BDaeBI_B.cjs} +50 -30
- package/dist/cli-chunks/{index-BjoSXl8C.cjs → index-CZGkk7fQ.cjs} +2 -2
- package/dist/cli-chunks/{index.esm-CigcxJ2B.cjs → index.esm-NNLG29Tt.cjs} +8 -7
- package/dist/cli-chunks/{login-Cumknwdx.cjs → login-DTY5GolC.cjs} +2 -2
- package/dist/cli-chunks/{project-vite-CcE-HMmd.cjs → project-vite-DlCjHlu_.cjs} +1 -1
- package/dist/cli-chunks/{remote-DDdP3xcE.cjs → remote-BBMr7j8W.cjs} +57 -25
- package/dist/cli-chunks/{runtime-gate-DFjw66kF.cjs → runtime-gate-BppCl1r3.cjs} +11 -3
- package/dist/cli-chunks/{runtime-permission-env-CjsCe5bp.cjs → runtime-permission-env-CqsTHeas.cjs} +351 -0
- package/dist/cli-chunks/{session-BDi_AZSv.cjs → session-CnGeZCRZ.cjs} +1 -1
- package/dist/cli-chunks/skill-B0yAnPOJ.cjs +83 -0
- package/dist/cli-chunks/version-DN5jrixS.cjs +8 -0
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-BhZGUyYw.js +97 -0
- package/dist/devtools/browser-dev-host/assets/heybox-logo-CogNENsk.svg +6 -0
- package/dist/devtools/browser-dev-host/assets/index-DJFB5ySU.css +1 -0
- package/dist/devtools/browser-dev-host/assets/index-Dh9H1JOm.js +567 -0
- package/dist/devtools/browser-dev-host/assets/workbench-state-wHgWRb7I.js +5 -0
- package/dist/devtools/browser-dev-host/index.html +6 -435
- package/dist/index.cjs.js +939 -29
- package/dist/index.esm.js +939 -30
- package/dist/protocol.cjs.js +381 -37
- package/dist/protocol.esm.js +355 -38
- package/dist/templates/{vue3-vite-ts → vanilla-vite-js}/.gitignore.ejs +0 -1
- package/dist/templates/vanilla-vite-js/README.md.ejs +14 -0
- package/dist/templates/vanilla-vite-js/index.html.ejs +20 -0
- package/dist/templates/vanilla-vite-js/package.json.ejs +22 -0
- package/dist/templates/vanilla-vite-js/src/assets/heybox-logo.svg +8 -0
- package/dist/templates/vanilla-vite-js/src/main.js +39 -0
- package/dist/templates/vanilla-vite-js/src/styles.css +155 -0
- package/dist/templates/{vue3-vite-ts/vite.config.ts → vanilla-vite-js/vite.config.js} +1 -2
- package/dist/vite.cjs.js +228 -9
- package/dist/vite.esm.js +228 -9
- package/package.json +36 -13
- package/skill/SKILL.md +22 -20
- package/skill/references/api-protocol.md +100 -6
- package/skill/references/api-root.md +166 -23
- package/skill/references/cli.md +41 -24
- package/skill/references/examples.md +30 -1
- package/skill/references/llms-index.md +1 -1
- package/skill/references/recipes.md +139 -36
- package/skill/references/safety-boundaries.md +14 -5
- package/skill/skill.json +10 -5
- package/types/core/client.d.ts +17 -1
- package/types/core/sdk.d.ts +3 -0
- package/types/core/singleton.d.ts +3 -0
- package/types/index.d.ts +4 -2
- package/types/miniapp-manifest/index.d.ts +1 -0
- package/types/miniapp-manifest/node.d.ts +3 -0
- package/types/miniapp-manifest/permissions.d.ts +37 -0
- package/types/miniapp-manifest/schema.d.ts +5 -0
- package/types/modules/files/index.d.ts +5 -0
- package/types/modules/files/registry.d.ts +35 -0
- package/types/modules/files/types.d.ts +159 -0
- package/types/modules/network/index.d.ts +50 -3
- package/types/modules/share/index.d.ts +1 -1
- package/types/modules/share/show-share-menu.d.ts +1 -1
- package/types/modules/share/types.d.ts +2 -4
- package/types/protocol/capabilities.d.ts +2 -2
- package/types/protocol/constants.d.ts +1 -1
- package/types/protocol/guards.d.ts +1 -1
- package/types/protocol/types.d.ts +1 -1
- package/types/protocol.d.ts +4 -3
- package/types/skill-metadata.d.ts +0 -4
- package/dist/cli-chunks/doctor-C95gIao_.cjs +0 -204
- package/dist/devtools/browser-dev-host/main.js +0 -12263
- package/dist/templates/vue3-vite-ts/README.md.ejs +0 -47
- package/dist/templates/vue3-vite-ts/index.html.ejs +0 -12
- package/dist/templates/vue3-vite-ts/package.json.ejs +0 -33
- package/dist/templates/vue3-vite-ts/src/App.vue +0 -78
- package/dist/templates/vue3-vite-ts/src/__tests__/App.spec.ts +0 -148
- package/dist/templates/vue3-vite-ts/src/auth-handoff.ts +0 -46
- package/dist/templates/vue3-vite-ts/src/main.ts +0 -5
- package/dist/templates/vue3-vite-ts/src/styles.css +0 -60
- package/dist/templates/vue3-vite-ts/src/vite-env.d.ts +0 -1
- package/dist/templates/vue3-vite-ts/tsconfig.app.json +0 -17
- package/dist/templates/vue3-vite-ts/tsconfig.json +0 -11
- package/dist/templates/vue3-vite-ts/tsconfig.node.json +0 -11
- package/dist/templates/vue3-vite-ts/vitest.config.ts +0 -10
- package/skill/scripts/check-references.mjs +0 -14
- package/skill/scripts/markdown-sections.mjs +0 -36
- package/skill/scripts/package-skill.mjs +0 -60
- package/skill/scripts/package-skill.sh +0 -6
- package/skill/scripts/skill-metadata.mjs +0 -77
- package/skill/scripts/sync-agent-skills-payload.mjs +0 -359
- package/skill/scripts/sync-references.mjs +0 -794
- package/skill/scripts/validate-skill.mjs +0 -263
package/dist/vite.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import { AsyncLocalStorage } from 'node:async_hooks';
|
|
|
5
5
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
6
6
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
7
7
|
? undefined
|
|
8
|
-
: '0.8.0-alpha';
|
|
8
|
+
: '0.8.0-alpha.10';
|
|
9
9
|
|
|
10
10
|
var re = {exports: {}};
|
|
11
11
|
|
|
@@ -2792,6 +2792,197 @@ function requireSemver () {
|
|
|
2792
2792
|
|
|
2793
2793
|
var semverExports = requireSemver();
|
|
2794
2794
|
|
|
2795
|
+
const MINI_PROGRAM_MESSAGE_NAMESPACE = 'heybox:miniprogram';
|
|
2796
|
+
const MINI_PROGRAM_MESSAGE_VERSION = 2;
|
|
2797
|
+
const MINI_PROGRAM_BRIDGE_NONCE_PARAM = 'hb_mini_bridge_nonce';
|
|
2798
|
+
|
|
2799
|
+
const MINI_PROGRAM_PERMISSION_KEYS = [
|
|
2800
|
+
'userInfo',
|
|
2801
|
+
'steamLibrary',
|
|
2802
|
+
'share',
|
|
2803
|
+
'storage',
|
|
2804
|
+
'filesystem',
|
|
2805
|
+
'clipboard',
|
|
2806
|
+
'leaderboard',
|
|
2807
|
+
'network',
|
|
2808
|
+
];
|
|
2809
|
+
const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
2810
|
+
{
|
|
2811
|
+
key: 'userInfo',
|
|
2812
|
+
name: '用户信息',
|
|
2813
|
+
description: '登录小程序并读取当前用户的授权信息。',
|
|
2814
|
+
access: 'declaration',
|
|
2815
|
+
risk: 'medium',
|
|
2816
|
+
config: {},
|
|
2817
|
+
methods: ['auth.login', 'user.getInfo'],
|
|
2818
|
+
conditions: ['继续执行黑盒登录、用户授权和可信手势规则。'],
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
key: 'steamLibrary',
|
|
2822
|
+
name: 'Steam 游戏库',
|
|
2823
|
+
description: '读取当前用户授权的 Steam 游戏库。',
|
|
2824
|
+
access: 'declaration',
|
|
2825
|
+
risk: 'high',
|
|
2826
|
+
config: {},
|
|
2827
|
+
methods: ['user.getSteamGameList'],
|
|
2828
|
+
conditions: ['继续执行账号绑定和数据可用性规则。'],
|
|
2829
|
+
},
|
|
2830
|
+
{
|
|
2831
|
+
key: 'share',
|
|
2832
|
+
name: '分享',
|
|
2833
|
+
description: '使用小程序分享、分享菜单和截图能力。',
|
|
2834
|
+
access: 'declaration',
|
|
2835
|
+
risk: 'medium',
|
|
2836
|
+
config: {},
|
|
2837
|
+
methods: ['share.copyLink', 'share.showShareMenu', 'share.screenshot'],
|
|
2838
|
+
conditions: ['继续执行分享参数校验和 Host 支持检查。'],
|
|
2839
|
+
},
|
|
2840
|
+
{
|
|
2841
|
+
key: 'storage',
|
|
2842
|
+
name: '键值存储',
|
|
2843
|
+
description: '读写按小程序隔离的简单键值数据。',
|
|
2844
|
+
access: 'declaration',
|
|
2845
|
+
risk: 'medium',
|
|
2846
|
+
config: {},
|
|
2847
|
+
methods: ['storage.getStorage', 'storage.setStorage'],
|
|
2848
|
+
conditions: ['仅用于简单键值存储,不包含文件系统。'],
|
|
2849
|
+
},
|
|
2850
|
+
{
|
|
2851
|
+
key: 'filesystem',
|
|
2852
|
+
name: '文件系统',
|
|
2853
|
+
description: '访问小程序沙盒文件和用户选择的外部文件。',
|
|
2854
|
+
access: 'declaration',
|
|
2855
|
+
risk: 'high',
|
|
2856
|
+
config: {},
|
|
2857
|
+
methods: [
|
|
2858
|
+
'network.download',
|
|
2859
|
+
'files.pickFiles',
|
|
2860
|
+
'files.pickDirectory',
|
|
2861
|
+
'files.saveFile',
|
|
2862
|
+
'file.create',
|
|
2863
|
+
'file.remove',
|
|
2864
|
+
'file.exists',
|
|
2865
|
+
'file.readText',
|
|
2866
|
+
'file.writeText',
|
|
2867
|
+
'file.readBytes',
|
|
2868
|
+
'file.writeBytes',
|
|
2869
|
+
'file.stat',
|
|
2870
|
+
'directory.create',
|
|
2871
|
+
'directory.remove',
|
|
2872
|
+
'directory.exists',
|
|
2873
|
+
'directory.list',
|
|
2874
|
+
],
|
|
2875
|
+
conditions: ['外部文件继续要求有效的用户选择、会话句柄和匹配的读写模式。'],
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
key: 'clipboard',
|
|
2879
|
+
name: '剪贴板',
|
|
2880
|
+
description: '向系统剪贴板写入文本。',
|
|
2881
|
+
access: 'declaration',
|
|
2882
|
+
risk: 'medium',
|
|
2883
|
+
config: {},
|
|
2884
|
+
methods: ['device.setClipboard'],
|
|
2885
|
+
conditions: ['继续执行文本长度和 Host 支持限制。'],
|
|
2886
|
+
},
|
|
2887
|
+
{
|
|
2888
|
+
key: 'leaderboard',
|
|
2889
|
+
name: '排行榜',
|
|
2890
|
+
description: '读写小程序云排行榜。',
|
|
2891
|
+
access: 'declaration',
|
|
2892
|
+
risk: 'medium',
|
|
2893
|
+
config: {},
|
|
2894
|
+
methods: [
|
|
2895
|
+
'cloud.leaderboard.submit',
|
|
2896
|
+
'cloud.leaderboard.getList',
|
|
2897
|
+
'cloud.leaderboard.getCurrentUserEntry',
|
|
2898
|
+
'cloud.leaderboard.deleteCurrentUserEntry',
|
|
2899
|
+
'cloud.leaderboard.getInfo',
|
|
2900
|
+
],
|
|
2901
|
+
conditions: ['排行榜必须已创建,用户和资源规则保持不变。'],
|
|
2902
|
+
},
|
|
2903
|
+
{
|
|
2904
|
+
key: 'network',
|
|
2905
|
+
name: '网络',
|
|
2906
|
+
description: '通过 network 模块请求或下载外部资源。',
|
|
2907
|
+
access: 'platform-approval',
|
|
2908
|
+
risk: 'high',
|
|
2909
|
+
config: {
|
|
2910
|
+
useOfficialDomain: {
|
|
2911
|
+
type: 'boolean',
|
|
2912
|
+
required: false,
|
|
2913
|
+
default: false,
|
|
2914
|
+
description: '是否申请访问小黑盒官方域名。',
|
|
2915
|
+
},
|
|
2916
|
+
},
|
|
2917
|
+
methods: ['network.request', 'network.download'],
|
|
2918
|
+
conditions: ['声明后仍需平台批准,并继续执行网络安全策略。'],
|
|
2919
|
+
},
|
|
2920
|
+
];
|
|
2921
|
+
new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
2922
|
+
|
|
2923
|
+
new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
2924
|
+
|
|
2925
|
+
const MINIAPP_PERMISSION_KEYS = MINI_PROGRAM_PERMISSION_KEYS;
|
|
2926
|
+
function parseMiniappPermissions(value, options) {
|
|
2927
|
+
const sourceLabel = options.sourceLabel ?? 'package.json#heybox.permissions';
|
|
2928
|
+
if (!options.present) {
|
|
2929
|
+
if (requiresExplicitPermissions(options.sdkVersion)) {
|
|
2930
|
+
throw new Error(`${sourceLabel} 在 @heybox/hb-sdk ${options.sdkVersion} 中必须声明;无权限需求时请配置空对象 {}`);
|
|
2931
|
+
}
|
|
2932
|
+
return { declared: false };
|
|
2933
|
+
}
|
|
2934
|
+
if (!isRecord$1(value)) {
|
|
2935
|
+
throw new Error(`${sourceLabel} 必须是 JSON 对象`);
|
|
2936
|
+
}
|
|
2937
|
+
const knownKeys = new Set(MINIAPP_PERMISSION_KEYS);
|
|
2938
|
+
for (const key of Object.keys(value)) {
|
|
2939
|
+
if (!knownKeys.has(key))
|
|
2940
|
+
throw new Error(`${sourceLabel} 包含未知权限:${key}`);
|
|
2941
|
+
}
|
|
2942
|
+
const permissions = {};
|
|
2943
|
+
for (const key of MINIAPP_PERMISSION_KEYS) {
|
|
2944
|
+
if (!Object.prototype.hasOwnProperty.call(value, key))
|
|
2945
|
+
continue;
|
|
2946
|
+
const declaration = value[key];
|
|
2947
|
+
const itemLabel = `${sourceLabel}.${key}`;
|
|
2948
|
+
if (!isRecord$1(declaration))
|
|
2949
|
+
throw new Error(`${itemLabel} 必须是 JSON 对象`);
|
|
2950
|
+
const definition = MINI_PROGRAM_PERMISSION_CATALOG.find((item) => item.key === key);
|
|
2951
|
+
if (!definition)
|
|
2952
|
+
throw new Error(`权限目录缺少定义:${key}`);
|
|
2953
|
+
const allowedFields = new Set(['enabled', ...Object.keys(definition.config)]);
|
|
2954
|
+
for (const field of Object.keys(declaration)) {
|
|
2955
|
+
if (!allowedFields.has(field))
|
|
2956
|
+
throw new Error(`${itemLabel} 包含未知字段:${field}`);
|
|
2957
|
+
}
|
|
2958
|
+
if (typeof declaration.enabled !== 'boolean')
|
|
2959
|
+
throw new Error(`${itemLabel}.enabled 必须是 boolean`);
|
|
2960
|
+
let useOfficialDomain = false;
|
|
2961
|
+
if (key === 'network') {
|
|
2962
|
+
if (declaration.useOfficialDomain !== undefined && typeof declaration.useOfficialDomain !== 'boolean') {
|
|
2963
|
+
throw new Error(`${itemLabel}.useOfficialDomain 必须是 boolean`);
|
|
2964
|
+
}
|
|
2965
|
+
useOfficialDomain = declaration.useOfficialDomain === true;
|
|
2966
|
+
}
|
|
2967
|
+
if (!declaration.enabled)
|
|
2968
|
+
continue;
|
|
2969
|
+
permissions[key] = key === 'network' ? { enabled: true, useOfficialDomain } : { enabled: true };
|
|
2970
|
+
}
|
|
2971
|
+
return { declared: true, permissions: permissions };
|
|
2972
|
+
}
|
|
2973
|
+
function requiresExplicitPermissions(sdkVersion) {
|
|
2974
|
+
const parsed = semverExports.parse(sdkVersion);
|
|
2975
|
+
if (!parsed)
|
|
2976
|
+
throw new Error(`sdkVersion 必须是合法 SemVer:${sdkVersion}`);
|
|
2977
|
+
return parsed.major > 0 || parsed.minor >= 9;
|
|
2978
|
+
}
|
|
2979
|
+
function getMissingPermissionsWarning(sourceLabel = 'package.json#heybox.permissions') {
|
|
2980
|
+
return `${sourceLabel} 尚未声明。当前按 0.8 兼容行为构建;0.9.0 起将拒绝构建,请尽快补充权限声明(无权限需求时配置 {})。`;
|
|
2981
|
+
}
|
|
2982
|
+
function isRecord$1(value) {
|
|
2983
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2795
2986
|
const MINIAPP_PLATFORM_VALUES = ['android', 'ios', 'ohos', 'windows', 'macos', 'linux'];
|
|
2796
2987
|
function validateMiniappPackageVersionForBuild(version) {
|
|
2797
2988
|
return validateMiniappManifestVersion(version, 'package.json.version');
|
|
@@ -2805,7 +2996,13 @@ function validateMiniappManifestVersion(version, sourceLabel = 'manifest.version
|
|
|
2805
2996
|
}
|
|
2806
2997
|
function renderMiniappManifest(manifest) {
|
|
2807
2998
|
const platforms = validateMiniappPlatforms(manifest.platforms, 'manifest.platforms');
|
|
2808
|
-
|
|
2999
|
+
const output = {
|
|
3000
|
+
version: manifest.version,
|
|
3001
|
+
sdkVersion: manifest.sdkVersion,
|
|
3002
|
+
platforms,
|
|
3003
|
+
...(manifest.permissions === undefined ? {} : { permissions: manifest.permissions }),
|
|
3004
|
+
};
|
|
3005
|
+
return `${JSON.stringify(output, null, 2)}\n`;
|
|
2809
3006
|
}
|
|
2810
3007
|
function validateMiniappPlatforms(platforms, sourceLabel = 'platforms') {
|
|
2811
3008
|
if (!Array.isArray(platforms) || platforms.length === 0) {
|
|
@@ -2860,6 +3057,21 @@ function findNearestPackageJsonPath(startDir) {
|
|
|
2860
3057
|
}
|
|
2861
3058
|
}
|
|
2862
3059
|
function readMiniappVersionFromPackageJson(root) {
|
|
3060
|
+
return readMiniappPackageJson(root, true).version;
|
|
3061
|
+
}
|
|
3062
|
+
function readMiniappPermissionsFromPackageJson(root, sdkVersion) {
|
|
3063
|
+
const { packageJson } = readMiniappPackageJson(root, false);
|
|
3064
|
+
const heybox = packageJson.heybox;
|
|
3065
|
+
if (heybox !== undefined && !isRecord(heybox)) {
|
|
3066
|
+
throw new Error('@heybox/hb-sdk 提示:package.json#heybox 必须是 JSON 对象');
|
|
3067
|
+
}
|
|
3068
|
+
const present = isRecord(heybox) && Object.prototype.hasOwnProperty.call(heybox, 'permissions');
|
|
3069
|
+
return parseMiniappPermissions(isRecord(heybox) ? heybox.permissions : undefined, {
|
|
3070
|
+
present,
|
|
3071
|
+
sdkVersion,
|
|
3072
|
+
});
|
|
3073
|
+
}
|
|
3074
|
+
function readMiniappPackageJson(root, requireVersion) {
|
|
2863
3075
|
const packageJsonPath = findNearestPackageJsonPath(root);
|
|
2864
3076
|
let content;
|
|
2865
3077
|
try {
|
|
@@ -2875,10 +3087,13 @@ function readMiniappVersionFromPackageJson(root) {
|
|
|
2875
3087
|
catch (error) {
|
|
2876
3088
|
throw new Error(`@heybox/hb-sdk 解析 package.json 失败:${formatReason(error)}`);
|
|
2877
3089
|
}
|
|
2878
|
-
if (typeof packageJson.version !== 'string' || packageJson.version.trim() === '') {
|
|
3090
|
+
if (requireVersion && (typeof packageJson.version !== 'string' || packageJson.version.trim() === '')) {
|
|
2879
3091
|
throw new Error('@heybox/hb-sdk 提示:package.json.version 必须是非空字符串');
|
|
2880
3092
|
}
|
|
2881
|
-
return packageJson.version.trim();
|
|
3093
|
+
return { packageJson, version: typeof packageJson.version === 'string' ? packageJson.version.trim() : '' };
|
|
3094
|
+
}
|
|
3095
|
+
function isRecord(value) {
|
|
3096
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
2882
3097
|
}
|
|
2883
3098
|
function formatReason(error) {
|
|
2884
3099
|
if (error instanceof Error && error.message) {
|
|
@@ -11317,10 +11532,6 @@ function parse(html, options) {
|
|
|
11317
11532
|
return Parser.parse(html, options);
|
|
11318
11533
|
}
|
|
11319
11534
|
|
|
11320
|
-
const MINI_PROGRAM_MESSAGE_NAMESPACE = 'heybox:miniprogram';
|
|
11321
|
-
const MINI_PROGRAM_MESSAGE_VERSION = 2;
|
|
11322
|
-
const MINI_PROGRAM_BRIDGE_NONCE_PARAM = 'hb_mini_bridge_nonce';
|
|
11323
|
-
|
|
11324
11535
|
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
11325
11536
|
const RUNTIME_GATE_MARKER = 'data-heybox-runtime-gate';
|
|
11326
11537
|
const RUNTIME_GATE_STYLE_MARKER = 'data-heybox-runtime-gate-style';
|
|
@@ -11696,6 +11907,9 @@ function miniappManifest(options) {
|
|
|
11696
11907
|
}
|
|
11697
11908
|
const version = validateMiniappPackageVersionForBuild(readMiniappVersionFromPackageJson(root));
|
|
11698
11909
|
const sdkVersion = resolveSdkVersion();
|
|
11910
|
+
const parsedPermissions = readMiniappPermissionsFromPackageJson(root, sdkVersion);
|
|
11911
|
+
if (!parsedPermissions.declared)
|
|
11912
|
+
this.warn(getMissingPermissionsWarning());
|
|
11699
11913
|
const outputRoot = path.resolve(root, outDir);
|
|
11700
11914
|
const htmlFiles = collectHtmlFiles(outputRoot);
|
|
11701
11915
|
const unexpectedHtmlFiles = htmlFiles.filter((file) => path.relative(outputRoot, file) !== 'index.html');
|
|
@@ -11711,7 +11925,12 @@ function miniappManifest(options) {
|
|
|
11711
11925
|
writeFileSync(indexHtmlPath, enforceMiniappHtmlPolicy(readFileSync(indexHtmlPath, 'utf8'), { skipPlatformCsp }));
|
|
11712
11926
|
const manifestPath = path.join(outputRoot, 'manifest.json');
|
|
11713
11927
|
mkdirSync(path.dirname(manifestPath), { recursive: true });
|
|
11714
|
-
writeFileSync(manifestPath, renderMiniappManifest({
|
|
11928
|
+
writeFileSync(manifestPath, renderMiniappManifest({
|
|
11929
|
+
version,
|
|
11930
|
+
sdkVersion,
|
|
11931
|
+
platforms,
|
|
11932
|
+
...(parsedPermissions.permissions === undefined ? {} : { permissions: parsedPermissions.permissions }),
|
|
11933
|
+
}));
|
|
11715
11934
|
},
|
|
11716
11935
|
};
|
|
11717
11936
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heybox/hb-sdk",
|
|
3
|
-
"version": "0.8.0-alpha",
|
|
3
|
+
"version": "0.8.0-alpha.10",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"./src/index.ts",
|
|
6
6
|
"./src/core/singleton.ts",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"files": [
|
|
45
45
|
"README.md",
|
|
46
46
|
"CHANGELOG.md",
|
|
47
|
+
"THIRD_PARTY_NOTICES.md",
|
|
47
48
|
"bin",
|
|
48
49
|
"dist",
|
|
49
50
|
"skill",
|
|
@@ -52,12 +53,16 @@
|
|
|
52
53
|
"keywords": [],
|
|
53
54
|
"author": "",
|
|
54
55
|
"license": "ISC",
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=22.20.0"
|
|
58
|
+
},
|
|
55
59
|
"dependencies": {
|
|
56
60
|
"@msgpack/msgpack": "2.8.0",
|
|
57
61
|
"parse5": "^7.3.0",
|
|
62
|
+
"skills": "1.5.23",
|
|
58
63
|
"undici": "^7.28.0",
|
|
59
64
|
"ws": "^8.18.0",
|
|
60
|
-
"@heybox/hb-sdk-protocol": "0.8.0-alpha"
|
|
65
|
+
"@heybox/hb-sdk-protocol": "0.8.0-alpha.10"
|
|
61
66
|
},
|
|
62
67
|
"peerDependencies": {
|
|
63
68
|
"vite": ">=5"
|
|
@@ -73,7 +78,8 @@
|
|
|
73
78
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
74
79
|
"@heybox/hb-types": "^1.0.1",
|
|
75
80
|
"@playwright/test": "^1.55.1",
|
|
76
|
-
"@
|
|
81
|
+
"@sneas/telephone": "1.1.2",
|
|
82
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
77
83
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
78
84
|
"@types/ejs": "^3.1.5",
|
|
79
85
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -82,6 +88,7 @@
|
|
|
82
88
|
"@types/semver": "^7.7.1",
|
|
83
89
|
"@types/ws": "^8.5.13",
|
|
84
90
|
"@vitest/coverage-v8": "^3.2.4",
|
|
91
|
+
"@vue/test-utils": "^2",
|
|
85
92
|
"commander": "^12.1.0",
|
|
86
93
|
"cos-nodejs-sdk-v5": "2.15.4",
|
|
87
94
|
"ejs": "^3.1.10",
|
|
@@ -89,22 +96,30 @@
|
|
|
89
96
|
"fs-extra": "^11.3.0",
|
|
90
97
|
"get-port": "^7.1.0",
|
|
91
98
|
"happy-dom": "^19.0.2",
|
|
99
|
+
"lucide-vue-next": "1.0.0",
|
|
100
|
+
"markdown-it": "^14.1.0",
|
|
92
101
|
"open": "^10.2.0",
|
|
93
102
|
"ora": "^5.4.1",
|
|
94
103
|
"picocolors": "^1.1.1",
|
|
95
104
|
"qrcode": "^1.5.4",
|
|
96
105
|
"rimraf": "^5.0.5",
|
|
106
|
+
"reka-ui": "2.10.4",
|
|
97
107
|
"rollup": "^4.52.4",
|
|
98
108
|
"semver": "^7.8.0",
|
|
109
|
+
"sass-embedded": "1.97.3",
|
|
110
|
+
"splitpanes": "^4.1.0",
|
|
99
111
|
"typescript": "^5.9.3",
|
|
100
|
-
"vue": "^
|
|
112
|
+
"vue": "^3.5.22",
|
|
113
|
+
"vue-tsc": "^3.3.7",
|
|
101
114
|
"vite": "^8.0.12",
|
|
102
115
|
"vitest": "^3.2.4",
|
|
103
|
-
"@heybox/
|
|
104
|
-
"@heybox/
|
|
116
|
+
"@heybox-domain/heybox-vue3-ui": "~0.1.0",
|
|
117
|
+
"@heybox-domain/heybox-theme": "~0.1.0",
|
|
118
|
+
"@heybox/hb-sdk-runtime": "~0.8.0-alpha.10",
|
|
119
|
+
"@heybox/hb-api": "~1.28.2",
|
|
105
120
|
"@heybox/runtime": "~0.2.0",
|
|
106
|
-
"@heybox/runtime-
|
|
107
|
-
"@heybox/runtime-
|
|
121
|
+
"@heybox/runtime-transport-fetch": "~0.2.0",
|
|
122
|
+
"@heybox/runtime-policy": "~0.2.0"
|
|
108
123
|
},
|
|
109
124
|
"publishConfig": {
|
|
110
125
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -117,6 +132,10 @@
|
|
|
117
132
|
"{projectRoot}/src/**/*",
|
|
118
133
|
"{projectRoot}/devtools/browser-dev-host/**/*",
|
|
119
134
|
"{projectRoot}/scripts/copy-browser-dev-host.cjs",
|
|
135
|
+
"{projectRoot}/scripts/check-browser-dev-host-assets.cjs",
|
|
136
|
+
"{projectRoot}/scripts/generate-browser-dev-host-notices.cjs",
|
|
137
|
+
"{projectRoot}/licenses/**/*",
|
|
138
|
+
"{projectRoot}/THIRD_PARTY_NOTICES.md",
|
|
120
139
|
"{projectRoot}/rollup.config.ts",
|
|
121
140
|
"{projectRoot}/tsconfig*.json",
|
|
122
141
|
"{workspaceRoot}/packages/hb-sdk-runtime/src/**/*",
|
|
@@ -144,30 +163,34 @@
|
|
|
144
163
|
"build:lib:bundle": "rollup -c rollup.config.ts --configPlugin 'typescript={\"tsconfig\":\"tsconfig.build.json\"}'",
|
|
145
164
|
"build:cli": "pnpm run build:hb-sdk-protocol && pnpm run build:hb-api-contract && pnpm run build:cli:bundle",
|
|
146
165
|
"build:cli:bundle": "rollup -c rollup.config.ts --environment HB_SDK_BUILD:cli --configPlugin 'typescript={\"tsconfig\":\"tsconfig.build.json\"}' && pnpm run build:browser-dev-host",
|
|
147
|
-
"build:browser-dev-host": "node scripts/
|
|
166
|
+
"build:browser-dev-host": "vite build --config vite.browser-dev-host.config.ts && node scripts/check-browser-dev-host-assets.cjs && node scripts/generate-browser-dev-host-notices.cjs",
|
|
148
167
|
"build:templates": "node scripts/copy-cli-templates.cjs",
|
|
149
168
|
"build:types": "tsc -p tsconfig.dts.json",
|
|
150
169
|
"check:boundary": "node scripts/check-boundary.cjs",
|
|
151
|
-
"check:docs-sync": "pnpm -
|
|
170
|
+
"check:docs-sync": "pnpm --filter @heybox-docs/docs-hb_sdk run check:reference && node scripts/skill/check-references.mjs && node scripts/skill/validate-skill.mjs",
|
|
152
171
|
"check:compatibility-evidence": "node scripts/validate-compatibility-evidence.mjs",
|
|
153
172
|
"check:api-semver": "node ../../ops/jobs/hb-sdk-docs-contract/semantic-diff.cjs",
|
|
154
173
|
"clean": "rimraf ./dist && rimraf ./types",
|
|
155
174
|
"test:unit": "NODE_OPTIONS='--conditions=heybox' vitest run",
|
|
156
175
|
"test:types:characterization": "tsc -p tsconfig.characterization.json --noEmit --pretty false",
|
|
157
|
-
"test:types:browser-dev-host": "tsc -p tsconfig.browser-dev-host.json --noEmit --pretty false",
|
|
176
|
+
"test:types:browser-dev-host": "vue-tsc -p tsconfig.browser-dev-host.json --noEmit --pretty false",
|
|
158
177
|
"test:types": "pnpm run test:types:characterization && pnpm run test:types:browser-dev-host",
|
|
159
178
|
"test:e2e:browser-dev-host": "pnpm run build:browser-dev-host && NODE_OPTIONS='--conditions=heybox' vitest run --config vitest.browser-dev-host-e2e.config.ts",
|
|
179
|
+
"test:create-template:artifact": "node scripts/test-create-template-artifact.mjs",
|
|
160
180
|
"test:unit:coverage": "NODE_OPTIONS='--conditions=heybox' vitest run --coverage",
|
|
161
181
|
"test:vite": "pnpm run build:hb-sdk-protocol && pnpm run build:hb-api-contract && vitest run --config vitest.vite.config.ts",
|
|
162
182
|
"test:watch": "NODE_OPTIONS='--conditions=heybox' vitest",
|
|
163
183
|
"changelog:draft": "node scripts/changelog-draft.cjs",
|
|
164
184
|
"check:changelog": "node scripts/check-changelog.cjs",
|
|
165
|
-
"
|
|
185
|
+
"release:verify-tarball": "node scripts/skill/verify-tarball-install.mjs",
|
|
186
|
+
"test:release": "node --test scripts/public-changelog.test.mjs scripts/public-changelog-workflow.test.cjs scripts/release-family.test.cjs ../../ops/jobs/publish-changed-packages/publish.test.cjs ../../ops/jobs/release-hb-sdk/docs-release-contract.test.cjs ../../ops/jobs/release-hb-sdk/stable-promote-coordinator.test.cjs",
|
|
166
187
|
"test:compatibility-evidence": "node --test scripts/validate-compatibility-evidence.test.mjs",
|
|
167
188
|
"release:prepare": "node scripts/release-prepare.cjs",
|
|
168
189
|
"release:tag": "node scripts/release-tag.cjs",
|
|
169
190
|
"release:family:dry-run": "node ../../ops/jobs/publish-changed-packages/publish.cjs --dry-run",
|
|
170
191
|
"release:family:promote": "node ../../ops/jobs/publish-changed-packages/publish.cjs --family-action promote",
|
|
171
|
-
"release:family:rollback": "node ../../ops/jobs/publish-changed-packages/publish.cjs --family-action rollback"
|
|
192
|
+
"release:family:rollback": "node ../../ops/jobs/publish-changed-packages/publish.cjs --family-action rollback",
|
|
193
|
+
"release:stable:promote": "node ../../ops/jobs/release-hb-sdk/stable-promote-coordinator.cjs --action promote",
|
|
194
|
+
"release:stable:rollback": "node ../../ops/jobs/release-hb-sdk/stable-promote-coordinator.cjs --action rollback"
|
|
172
195
|
}
|
|
173
196
|
}
|
package/skill/SKILL.md
CHANGED
|
@@ -39,34 +39,35 @@ Apply these instructions when writing, reviewing, or debugging code that consume
|
|
|
39
39
|
## Step 4: Implement workshop mini-program code
|
|
40
40
|
|
|
41
41
|
1. Import the root package eagerly; the SDK starts its handshake automatically and capability calls wait for it internally.
|
|
42
|
-
2.
|
|
43
|
-
3.
|
|
44
|
-
4.
|
|
42
|
+
2. Declare protected capabilities in `package.json#heybox.permissions`. `auth.login()` and `user.getInfo()` require `userInfo`; `user.getSteamGameList()` requires `steamLibrary`; none of them implicitly require the public `network` permission.
|
|
43
|
+
3. Use `auth.login({ scopes? })` to obtain `{ code, expiresIn: 300, scopes }`. Identity is always implicit; request only optional scopes the business actually needs.
|
|
44
|
+
4. Send the code only to the developer's backend. That backend follows the backend OpenAPI documentation to exchange it for a token; mini-program code must never exchange application credentials itself.
|
|
45
45
|
5. Handle `HbMiniProgramSDKError` for SDK initialization and capability failures.
|
|
46
46
|
6. Handle `HbMiniProgramNetworkError` separately when HTTP completed but `validateStatus` rejected the status.
|
|
47
47
|
7. Use `getHandshakeState()` for the current persistent handshake state and `onHandshakeStateChange()` for an immediate replay plus future changes. Cancel the returned subscription when the page or component unmounts.
|
|
48
48
|
8. Treat the non-replayed `ready` lifecycle event only as an edge notification. After a duplicate handshake it may repeat, so never use it as state or as the source for enabling a late-mounted control.
|
|
49
49
|
9. Use the default SDK instance exposed by the root package. For gesture-gated controls, initialize from the current handshake state, subscribe to changes, and enable the control only when `status === 'ready'`. Keep calls such as `auth.login()` in the original user-action callback; do not wait for handshake inside that callback.
|
|
50
50
|
10. When authorization UI is required, call `auth.login()` from a trusted user action. Missing gesture returns `USER_GESTURE_REQUIRED`; cancelling, rejecting, or closing returns `AUTHORIZATION_CANCELLED` and does not confirm or change authorization. An already-authorized `auth.login()` request may return a new code silently.
|
|
51
|
-
11. `
|
|
52
|
-
12. Use `share.showShareMenu({
|
|
53
|
-
13.
|
|
51
|
+
11. Use `share.showShareMenu({ post })` or `share.screenshot({ post })` to preset editable community destinations and topics. Pass partition IDs through `topicIds` and topic text without surrounding `#` through `topics`; do not construct the underlying client post protocol.
|
|
52
|
+
12. Use `share.showShareMenu({ extra })` to open the share menu or `share.copyLink({ extra })` to copy and return the mini-program share link. `share.showShareMenu()` always uses the platform `common_share` landing page and does not accept a custom `url`. Read the JSON-compatible page state synchronously with `share.getExtra()` after launch, validate the developer-defined fields, and fall back to the default page when it returns `undefined`.
|
|
53
|
+
13. Treat `files` and `network.download()` as a retained public contract that is not yet enabled by a current Host. The legacy PC adapter was dropped because the new PC will implement the Host ports directly. Until then, legacy PC, Mobile, Web, and Browser Dev Host return `METHOD_FORBIDDEN` and provide no memory/Blob fallback. Once a supporting Host is available, call `files.pickFiles()` / `pickDirectory()` / `saveFile()` only from trusted user actions; `saveFile()` accepts only `suggestedName`, `remove()` only deletes sandbox objects, and non-empty directories require `remove({ recursive: true })`.
|
|
54
|
+
14. Use `network.download()` only with an SDK-created File/Directory target. It is GET-only, does not follow redirects, and exposes local `AbortSignal` / progress callbacks without sending functions over the bridge. Abort is a cancellation intent; a Host commit that already won still resolves successfully.
|
|
54
55
|
|
|
55
56
|
## Step 5: Use CLI workflows
|
|
56
57
|
|
|
57
58
|
1. Use `hb-sdk create <project-name>` to scaffold a workshop mini-program.
|
|
58
|
-
2. Use `hb-sdk dev` for Browser Mock
|
|
59
|
-
3.
|
|
59
|
+
2. Use `hb-sdk dev` for Browser Mock and Mobile App debugging. Browser debugging can start without CLI login, project binding, or a remote Dev Context; capabilities that need those inputs fail explicitly. Mobile uses the single QR entry with the `open_inapp` and `heybox://` `openWindow` wrapper around a LAN short URL, then opens `heybox-mini-dev://sandbox` with the complete launch context.
|
|
60
|
+
3. The debugging page does not edit permissions. Treat the validated remote permission snapshot as canonical Runtime input. Use `--port`, `--browser-dev-host-port`, and `--no-open` to control local endpoints and browser opening. Select a Mobile network interface the device can reach. `launch.json` is a LAN discovery document, not authentication, encryption, signing, or HMAC protection.
|
|
60
61
|
4. Use `hb-sdk build [--env <name>] [--verbose]` as the recommended production build entry. It directly owns the Vite build, always cleans and writes `dist/`, and works without CLI login, project binding, or network access.
|
|
61
62
|
5. Keep `miniappManifest()` explicitly enabled in `vite.config.ts`; `hb-sdk build` must fail when the required Manifest or Runtime gate output is missing.
|
|
62
63
|
6. Keep project typechecking in `scripts.build`, for example `vue-tsc --noEmit && hb-sdk build`; `hb-sdk build` does not run typechecking or invoke `scripts.build` itself.
|
|
63
64
|
7. Existing projects may continue to use `vite build`; do not auto-migrate them. Do not invent `--mode`, `--json`, config, or output-directory flags for `hb-sdk build`.
|
|
64
|
-
8. Use `hb-sdk login`, `hb-sdk login status`, and `hb-sdk login clear` for
|
|
65
|
+
8. Use `hb-sdk login`, `hb-sdk login status`, and `hb-sdk login clear` for remote management, publishing, Mobile debugging, and optional Browser Mock Host `heybox-session` requests. Browser debugging itself can start without CLI login. Mini-program code must still call `auth.login()`; the debug page only confirms authorization. Do not paste CLI credentials into page JavaScript. Phone debugging continues to use the App login.
|
|
65
66
|
9. Use `hb-sdk remote entity current` to confirm the current developer account and `hb-sdk remote entity switch <entity-id>` to change it before remote operations.
|
|
66
67
|
10. Use `hb-sdk remote create` to create and bind a mini-program; use `hb-sdk remote bind <mini-program-id>` to bind an existing manageable mini-program.
|
|
67
68
|
11. Use `hb-sdk remote info`, `hb-sdk remote list`, `hb-sdk remote access`, `hb-sdk remote versions`, `hb-sdk remote preview <version>`, and `hb-sdk remote allowlist ...` for remote inspection and preview management.
|
|
68
69
|
12. Use `hb-sdk remote deploy --release-note <text>` to run the project's `scripts.build`, upload, and submit the current project for audit. Do not recommend the removed top-level `hb-sdk deploy` alias.
|
|
69
|
-
13. `hb-sdk dev` and `hb-sdk remote deploy` skip the platform CSP only when the
|
|
70
|
+
13. `hb-sdk dev` and `hb-sdk remote deploy` skip the platform CSP only when the current version declares and the platform approves `network`. `useOfficialDomain` does not participate in CSP skip decisions. Direct `hb-sdk build`, direct Vite build, anonymous or invalid snapshots, and local Dev Context overrides must keep the platform CSP. Runtime Gate, Manifest, and HTML validation always remain active.
|
|
70
71
|
14. After approval, use `hb-sdk remote release <version>` for manual release or `--auto-publish` when an eligible low-risk version should release automatically.
|
|
71
72
|
15. Treat approval, release, and public display as separate states. Do not promise square, search, or recommendation visibility after release.
|
|
72
73
|
16. Use `hb-sdk remote withdraw`, `hb-sdk remote take-down`, `hb-sdk remote reopen`, and square visibility commands only after showing the target and obtaining required confirmation.
|
|
@@ -81,11 +82,12 @@ For workshop mini-program business code:
|
|
|
81
82
|
1. Do not read or request tokens, cookies, phone numbers, or private credentials from the SDK.
|
|
82
83
|
2. Do not expose raw share protocol fields, JS callbacks, activity reporting, custom buttons, direct post publishing, or upload-only flows. Public `share.*({ post })` options only preset an editable client post flow and never publish automatically.
|
|
83
84
|
3. Do not use unsupported storage operations such as delete, clear, info listing, or global client storage access.
|
|
84
|
-
4. Use only the public `network.request`
|
|
85
|
+
4. Use only the public `network.request` / `network.download` configurations.
|
|
85
86
|
5. Do not use private package paths or client protocols.
|
|
86
87
|
6. Build artifacts may include `dist/manifest.json`; business code should not fetch a deployed manifest directly because it is not a CDN asset.
|
|
87
88
|
7. Do not use `network.request()` to reach platform-reserved runtime auth or OpenAPI internal paths.
|
|
88
89
|
8. Do not expose credentials or describe internal Host authorization state machines and routes in app-facing guidance.
|
|
90
|
+
9. Do not invent string paths, File System Access API handles, Blob downloads, uploads, Range/resume, external deletion, move, append, or persistent external grants. Public file operations use only SDK-created handles; deletion is limited to SDK sandbox handles.
|
|
89
91
|
|
|
90
92
|
For CLI and local development:
|
|
91
93
|
|
|
@@ -93,8 +95,9 @@ For CLI and local development:
|
|
|
93
95
|
2. Do not skip `auth.login()` in mini-program code. Browser Mock may reuse the Node `hb-sdk login` session for Host network requests, but the page must still call `auth.login()` and handle the authorization dialog. Never paste CLI credentials into page JavaScript.
|
|
94
96
|
3. Use the built-in local debugging page instead of creating another browser Mock.
|
|
95
97
|
4. Keep the Vite `miniappManifest()` plugin enabled.
|
|
96
|
-
5.
|
|
98
|
+
5. Do not suggest changing or resetting permissions in the `hb-sdk dev` debugging page; that UI does not exist. Diagnose permission behavior from the remote snapshot and capability result.
|
|
97
99
|
6. Treat browser Mock results as development feedback only. Validate permissions, identity flows, and user interactions again in a real Heybox client before publishing.
|
|
100
|
+
7. The Browser Dev Host offers iPhone 16 Pro Max (`440 x 956`) and Pixel 9 Pro (`410 x 914`) presets. Switching a preset must preserve the iframe, Runtime session, and page state. Authorization/action dialogs, Toast, Loading, and vibration feedback render inside the preview. Use the upper-right QR popover as the only Mobile QR entry.
|
|
98
101
|
|
|
99
102
|
For host/runtime/protocol-maintenance code:
|
|
100
103
|
|
|
@@ -110,17 +113,16 @@ For host/runtime/protocol-maintenance code:
|
|
|
110
113
|
- `cat packages/hb-sdk/DOC_SYNC_CHECKLIST.md`
|
|
111
114
|
3. When preparing a package release, run `pnpm --filter @heybox/hb-sdk run release:prepare -- --bump patch` or `pnpm --filter @heybox/hb-sdk run release:prepare -- --version <x.y.z>`. The release assistant updates the Protocol/Runtime/SDK family versions, inserts `packages/hb-sdk/CHANGELOG.md`, and runs `check:changelog`. Use `--ai-command "<command>"` or `HB_SDK_CHANGELOG_AI_COMMAND` when an AI writer should rewrite the Conventional Commit draft. Review the entry for Mini-program developers and Host/Runtime integration maintainers, and do not expose Runtime internal adapter, state-machine, or security-policy details.
|
|
112
115
|
4. When modifying this repo's source skill at `packages/hb-sdk/skill` and preparing distributable artifacts, also run:
|
|
113
|
-
- `node packages/hb-sdk/skill/
|
|
116
|
+
- `node packages/hb-sdk/scripts/skill/sync-references.mjs`
|
|
117
|
+
- `node packages/hb-sdk/scripts/skill/validate-skill.mjs`
|
|
114
118
|
5. When modifying CLI, local debugging, package exports, or package dependency direction, also run:
|
|
115
119
|
- `pnpm --filter @heybox/hb-sdk run check:boundary`
|
|
116
120
|
- `pnpm --filter @heybox/hb-sdk run test:unit`
|
|
117
|
-
6.
|
|
118
|
-
- `unzip -l packages/hb-sdk/hb-sdk.zip | sed -n '1,120p'`
|
|
119
|
-
7. When adding or modifying the deploy command or its upload pipeline, also run:
|
|
121
|
+
6. When adding or modifying the deploy command or its upload pipeline, also run:
|
|
120
122
|
- `pnpm --filter @heybox/hb-sdk run check:boundary`
|
|
121
123
|
- `pnpm --filter @heybox/hb-sdk run test:unit`
|
|
122
124
|
- Verify `dist/cli.cjs` does not have any `require('cos-nodejs-sdk-v5')` left after `build:cli`; the boundary check enforces this automatically.
|
|
123
|
-
|
|
124
|
-
- `
|
|
125
|
-
- `
|
|
126
|
-
- For a release artifact, run `
|
|
125
|
+
7. Verify the canonical payload before publishing:
|
|
126
|
+
- `node packages/hb-sdk/scripts/skill/sync-references.mjs`
|
|
127
|
+
- `node packages/hb-sdk/scripts/skill/validate-skill.mjs`
|
|
128
|
+
- For a release artifact, run `npm pack --dry-run` and `node packages/hb-sdk/scripts/skill/verify-tarball-install.mjs`.
|