@heybox/hb-sdk 0.9.2-alpha.8 → 0.9.2
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 +42 -0
- package/README.md +2 -2
- package/dist/card-controller.cjs.js +35 -3
- package/dist/card-controller.esm.js +35 -3
- package/dist/cli-chunks/{build-BinntZJf.cjs → build-Dw22VIXS.cjs} +5 -5
- package/dist/cli-chunks/{context-BI3QMxw2.cjs → context-wxnfvTjH.cjs} +2 -2
- package/dist/cli-chunks/{create-BK028Mlk.cjs → create-ecaoeTnL.cjs} +1 -1
- package/dist/cli-chunks/{deploy-lock-pKDDxTKm.cjs → deploy-lock--NJ7NdXX.cjs} +1 -1
- package/dist/cli-chunks/{dev-DeNzUY6g.cjs → dev-Brpzyt0U.cjs} +8 -8
- package/dist/cli-chunks/{doctor-BOfbKnN2.cjs → doctor-D9YqT9KQ.cjs} +1 -1
- package/dist/cli-chunks/{games-yqu20laX.cjs → games-C1ecYTTz.cjs} +2 -2
- package/dist/cli-chunks/{index-C7nrP0tt.cjs → index-B3Rry_DT.cjs} +1 -1
- package/dist/cli-chunks/{index-CY67PpQk.cjs → index-BbBDiBGu.cjs} +17 -17
- package/dist/cli-chunks/{index.esm-DQdwzMhB.cjs → index.esm-4AAnDlTK.cjs} +6 -6
- package/dist/cli-chunks/{login-PJdMmFoB.cjs → login-e8GwAqrB.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-Dm128JTE.cjs → project-vite-CCK80P0l.cjs} +1 -1
- package/dist/cli-chunks/{remote-CZuy1lmn.cjs → remote-BrcgN56P.cjs} +7 -7
- package/dist/cli-chunks/{runtime-gate-g3afiufR.cjs → runtime-gate-DlljPriy.cjs} +3 -2
- package/dist/cli-chunks/{runtime-permission-env-CDx5qO-T.cjs → runtime-permission-env-BHzCLf1O.cjs} +14 -2
- package/dist/cli-chunks/{skill-Bdy5Ehue.cjs → skill-DzD5EQiw.cjs} +2 -2
- package/dist/cli-chunks/{version-D40WHkF9.cjs → version-Cg_M8yWW.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/{browser-dev-host-BW7iWnpt.js → browser-dev-host-BRNJVknP.js} +1 -1
- package/dist/devtools/browser-dev-host/assets/{desktop-app-launch-lmlBUG16.js → desktop-app-launch-DcTaMyDt.js} +1 -1
- package/dist/devtools/browser-dev-host/assets/{index-D7F2y1lF.js → index-p1R5T0MK.js} +3 -3
- package/dist/devtools/browser-dev-host/index.html +2 -2
- package/dist/index.cjs.js +13 -5
- package/dist/index.esm.js +13 -5
- package/dist/miniapp-publish.cjs.js +13 -81
- package/dist/miniapp-publish.esm.js +14 -80
- package/dist/protocol.cjs.js +13 -0
- package/dist/protocol.esm.js +13 -0
- package/dist/vite.cjs.js +6 -1
- package/dist/vite.esm.js +6 -1
- package/package.json +6 -5
- package/skill/skill.json +4 -4
- package/types/card-controller.d.ts +35 -3
- package/types/index.d.ts +51 -51
- package/types/miniapp-publish/index.d.ts +15 -60
- package/types/protocol.d.ts +10 -10
- package/types/vite/index.d.ts +1 -0
package/dist/protocol.cjs.js
CHANGED
|
@@ -504,6 +504,7 @@ const MINI_PROGRAM_PROTOCOL_CAPABILITIES = [
|
|
|
504
504
|
* @see [MINI_PROGRAM_BRIDGE_NONCE_PARAM](/reference/symbols/protocol/constants/MINI_PROGRAM_BRIDGE_NONCE_PARAM) iframe URL 中的 nonce 参数名。
|
|
505
505
|
* @see [MINI_PROGRAM_PROTOCOL_CAPABILITIES](/reference/symbols/protocol/constants/MINI_PROGRAM_PROTOCOL_CAPABILITIES) 公开 method 与权限 requirement 目录。
|
|
506
506
|
* @see [parseMiniProgramRuntimePermissions](/reference/symbols/protocol/functions/parseMiniProgramRuntimePermissions) Runtime 权限快照解析器。
|
|
507
|
+
* @since 0.3.1
|
|
507
508
|
*/
|
|
508
509
|
function isMiniProgramBridgeMessage(value) {
|
|
509
510
|
if (!isRecord$3(value))
|
|
@@ -588,6 +589,7 @@ function isMiniProgramBridgeMessage(value) {
|
|
|
588
589
|
* @see [PathRoot](/reference/symbols/root/interfaces/PathRoot) 提供 `file()` / `directory()` 的 SDK 路径入口。
|
|
589
590
|
* @see [FileSystem](/reference/symbols/root/interfaces/FileSystem) `files.sandbox` 逻辑路径能力。
|
|
590
591
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 已授权目录下的相对路径能力。
|
|
592
|
+
* @since 0.8.0
|
|
591
593
|
*/
|
|
592
594
|
function isMiniProgramRelativePath(value) {
|
|
593
595
|
if (typeof value !== 'string' || !value || value.startsWith('/') || value.endsWith('/')) {
|
|
@@ -654,6 +656,7 @@ function isMiniProgramRelativePath(value) {
|
|
|
654
656
|
* @see [PathRoot](/reference/symbols/root/interfaces/PathRoot) SDK 公开的逻辑路径 root 能力。
|
|
655
657
|
* @see [FilesModule](/reference/symbols/root/interfaces/FilesModule) 提供 `files.sandbox` 与目录 picker 的入口。
|
|
656
658
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 可作为 derived path root 的目录代理。
|
|
659
|
+
* @since 0.8.0
|
|
657
660
|
*/
|
|
658
661
|
function isMiniProgramPathRootRef(value) {
|
|
659
662
|
if (!isRecord$3(value))
|
|
@@ -720,6 +723,7 @@ function isMiniProgramPathRootRef(value) {
|
|
|
720
723
|
* @see [isMiniProgramFileDescriptor](/reference/symbols/protocol/functions/isMiniProgramFileDescriptor) 包含名称和 mode 的文件 descriptor guard。
|
|
721
724
|
* @see [isMiniProgramDirectoryRef](/reference/symbols/protocol/functions/isMiniProgramDirectoryRef) 可用 `'.'` 指向 root 自身的目录引用 guard。
|
|
722
725
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 使用文件引用的公开 I/O 代理。
|
|
726
|
+
* @since 0.8.0
|
|
723
727
|
*/
|
|
724
728
|
function isMiniProgramFileRef(value) {
|
|
725
729
|
if (!isRecord$3(value) || value.kind !== 'file')
|
|
@@ -787,6 +791,7 @@ function isMiniProgramFileRef(value) {
|
|
|
787
791
|
* @see [isMiniProgramDirectoryDescriptor](/reference/symbols/protocol/functions/isMiniProgramDirectoryDescriptor) 包含名称和 mode 的目录 descriptor guard。
|
|
788
792
|
* @see [isMiniProgramFileRef](/reference/symbols/protocol/functions/isMiniProgramFileRef) 不接受 root 自身 `'.'` 的文件引用 guard。
|
|
789
793
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 使用目录引用的公开路径操作代理。
|
|
794
|
+
* @since 0.8.0
|
|
790
795
|
*/
|
|
791
796
|
function isMiniProgramDirectoryRef(value) {
|
|
792
797
|
if (!isRecord$3(value) || value.kind !== 'directory')
|
|
@@ -861,6 +866,7 @@ function isMiniProgramDirectoryRef(value) {
|
|
|
861
866
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 校验后由 SDK 建立的文件代理。
|
|
862
867
|
* @see [PickFilesResult](/reference/symbols/protocol/types/PickFilesResult) picker 的 direct-ref 文件结果。
|
|
863
868
|
* @see [SaveFileResult](/reference/symbols/protocol/types/SaveFileResult) save picker 的 direct-ref 文件结果。
|
|
869
|
+
* @since 0.8.0
|
|
864
870
|
*/
|
|
865
871
|
function isMiniProgramFileDescriptor(value) {
|
|
866
872
|
return (isRecord$3(value) &&
|
|
@@ -931,6 +937,7 @@ function isMiniProgramFileDescriptor(value) {
|
|
|
931
937
|
* @see [FilesModule](/reference/symbols/root/interfaces/FilesModule) `files` 公开能力入口。
|
|
932
938
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 校验后由 SDK 建立的目录代理。
|
|
933
939
|
* @see [PickDirectoryResult](/reference/symbols/protocol/types/PickDirectoryResult) picker 的 direct-ref 返回契约。
|
|
940
|
+
* @since 0.8.0
|
|
934
941
|
*/
|
|
935
942
|
function isMiniProgramDirectoryDescriptor(value) {
|
|
936
943
|
return (isRecord$3(value) &&
|
|
@@ -996,6 +1003,7 @@ function isMiniProgramDirectoryDescriptor(value) {
|
|
|
996
1003
|
* @see [FileSystemEntity](/reference/symbols/root/types/FileSystemEntity) SDK 公开的 FileHandle/DirectoryHandle 联合。
|
|
997
1004
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 文件 descriptor 对应的能力代理。
|
|
998
1005
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 目录 descriptor 对应的能力代理及 `list()` 入口。
|
|
1006
|
+
* @since 0.8.0
|
|
999
1007
|
*/
|
|
1000
1008
|
function isMiniProgramFileSystemEntityDescriptor(value) {
|
|
1001
1009
|
return isMiniProgramFileDescriptor(value) || isMiniProgramDirectoryDescriptor(value);
|
|
@@ -1051,6 +1059,7 @@ function isMiniProgramFileSystemEntityDescriptor(value) {
|
|
|
1051
1059
|
* @see [CompanionStdio](/reference/symbols/root/interfaces/CompanionStdio) Companion 原始字节 stdin/stdout/stderr。
|
|
1052
1060
|
* @see [isMiniProgramFileDescriptor](/reference/symbols/protocol/functions/isMiniProgramFileDescriptor) 文件 descriptor guard。
|
|
1053
1061
|
* @see [isMiniProgramDirectoryDescriptor](/reference/symbols/protocol/functions/isMiniProgramDirectoryDescriptor) 目录 descriptor guard。
|
|
1062
|
+
* @since 0.8.0
|
|
1054
1063
|
*/
|
|
1055
1064
|
function isMiniProgramByteArray(value) {
|
|
1056
1065
|
return value instanceof Uint8Array && value.buffer instanceof ArrayBuffer;
|
|
@@ -1110,6 +1119,7 @@ function isMiniProgramByteArray(value) {
|
|
|
1110
1119
|
* @see [FileStatResult](/reference/symbols/protocol/types/FileStatResult) `file.stat` 的 wire 返回类型。
|
|
1111
1120
|
* @see [FileStat](/reference/symbols/root/interfaces/FileStat) SDK 向业务返回的元数据快照。
|
|
1112
1121
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 提供 `stat()` 的当前 session 文件代理。
|
|
1122
|
+
* @since 0.8.0
|
|
1113
1123
|
*/
|
|
1114
1124
|
function isMiniProgramFileStat(value) {
|
|
1115
1125
|
return (isRecord$3(value) &&
|
|
@@ -1170,6 +1180,7 @@ function isMiniProgramFileStat(value) {
|
|
|
1170
1180
|
* @see [DownloadProgress](/reference/symbols/root/interfaces/DownloadProgress) `onProgress` 接收的公开 SDK 进度类型。
|
|
1171
1181
|
* @see [network.download](/reference/sdk/network/download) 产生并消费该进度的下载能力。
|
|
1172
1182
|
* @see [isMiniProgramBridgeMessage](/reference/symbols/protocol/functions/isMiniProgramBridgeMessage) operation progress envelope 的最低校验。
|
|
1183
|
+
* @since 0.8.0
|
|
1173
1184
|
*/
|
|
1174
1185
|
function isMiniProgramDownloadProgressPayload(value) {
|
|
1175
1186
|
if (!isRecord$3(value) ||
|
|
@@ -1296,6 +1307,7 @@ const MANAGED_RUNTIME_PERMISSION_KEYS = new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
|
1296
1307
|
* @see [parseMiniProgramRuntimePermissions](/reference/symbols/protocol/functions/parseMiniProgramRuntimePermissions) 完整 snapshot 的 trim、legacy 归一化与 config 校验。
|
|
1297
1308
|
* @see [MINI_PROGRAM_PROTOCOL_CAPABILITIES](/reference/symbols/protocol/constants/MINI_PROGRAM_PROTOCOL_CAPABILITIES) method 到 permission requirement 的权威映射。
|
|
1298
1309
|
* @see [权限声明](/guide/permissions) Manifest 声明、平台批准与 Runtime 状态的完整流程。
|
|
1310
|
+
* @since 0.6.4
|
|
1299
1311
|
*/
|
|
1300
1312
|
function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
1301
1313
|
return MANAGED_RUNTIME_PERMISSION_KEYS.has(key);
|
|
@@ -1371,6 +1383,7 @@ function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
|
1371
1383
|
* @see {@link isManagedMiniProgramRuntimePermissionKey}
|
|
1372
1384
|
* @see {@link MINI_PROGRAM_PROTOCOL_CAPABILITIES}
|
|
1373
1385
|
* @see {@link https://docs.xiaoheihe.cn/hb_sdk/guide/permissions | 权限声明}
|
|
1386
|
+
* @since 0.6.4
|
|
1374
1387
|
*/
|
|
1375
1388
|
function parseMiniProgramRuntimePermissions(snapshot) {
|
|
1376
1389
|
if (!isRecord$2(snapshot) || snapshot.schema_version !== 1 || !Array.isArray(snapshot.entries)) {
|
package/dist/protocol.esm.js
CHANGED
|
@@ -502,6 +502,7 @@ const MINI_PROGRAM_PROTOCOL_CAPABILITIES = [
|
|
|
502
502
|
* @see [MINI_PROGRAM_BRIDGE_NONCE_PARAM](/reference/symbols/protocol/constants/MINI_PROGRAM_BRIDGE_NONCE_PARAM) iframe URL 中的 nonce 参数名。
|
|
503
503
|
* @see [MINI_PROGRAM_PROTOCOL_CAPABILITIES](/reference/symbols/protocol/constants/MINI_PROGRAM_PROTOCOL_CAPABILITIES) 公开 method 与权限 requirement 目录。
|
|
504
504
|
* @see [parseMiniProgramRuntimePermissions](/reference/symbols/protocol/functions/parseMiniProgramRuntimePermissions) Runtime 权限快照解析器。
|
|
505
|
+
* @since 0.3.1
|
|
505
506
|
*/
|
|
506
507
|
function isMiniProgramBridgeMessage(value) {
|
|
507
508
|
if (!isRecord$3(value))
|
|
@@ -586,6 +587,7 @@ function isMiniProgramBridgeMessage(value) {
|
|
|
586
587
|
* @see [PathRoot](/reference/symbols/root/interfaces/PathRoot) 提供 `file()` / `directory()` 的 SDK 路径入口。
|
|
587
588
|
* @see [FileSystem](/reference/symbols/root/interfaces/FileSystem) `files.sandbox` 逻辑路径能力。
|
|
588
589
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 已授权目录下的相对路径能力。
|
|
590
|
+
* @since 0.8.0
|
|
589
591
|
*/
|
|
590
592
|
function isMiniProgramRelativePath(value) {
|
|
591
593
|
if (typeof value !== 'string' || !value || value.startsWith('/') || value.endsWith('/')) {
|
|
@@ -652,6 +654,7 @@ function isMiniProgramRelativePath(value) {
|
|
|
652
654
|
* @see [PathRoot](/reference/symbols/root/interfaces/PathRoot) SDK 公开的逻辑路径 root 能力。
|
|
653
655
|
* @see [FilesModule](/reference/symbols/root/interfaces/FilesModule) 提供 `files.sandbox` 与目录 picker 的入口。
|
|
654
656
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 可作为 derived path root 的目录代理。
|
|
657
|
+
* @since 0.8.0
|
|
655
658
|
*/
|
|
656
659
|
function isMiniProgramPathRootRef(value) {
|
|
657
660
|
if (!isRecord$3(value))
|
|
@@ -718,6 +721,7 @@ function isMiniProgramPathRootRef(value) {
|
|
|
718
721
|
* @see [isMiniProgramFileDescriptor](/reference/symbols/protocol/functions/isMiniProgramFileDescriptor) 包含名称和 mode 的文件 descriptor guard。
|
|
719
722
|
* @see [isMiniProgramDirectoryRef](/reference/symbols/protocol/functions/isMiniProgramDirectoryRef) 可用 `'.'` 指向 root 自身的目录引用 guard。
|
|
720
723
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 使用文件引用的公开 I/O 代理。
|
|
724
|
+
* @since 0.8.0
|
|
721
725
|
*/
|
|
722
726
|
function isMiniProgramFileRef(value) {
|
|
723
727
|
if (!isRecord$3(value) || value.kind !== 'file')
|
|
@@ -785,6 +789,7 @@ function isMiniProgramFileRef(value) {
|
|
|
785
789
|
* @see [isMiniProgramDirectoryDescriptor](/reference/symbols/protocol/functions/isMiniProgramDirectoryDescriptor) 包含名称和 mode 的目录 descriptor guard。
|
|
786
790
|
* @see [isMiniProgramFileRef](/reference/symbols/protocol/functions/isMiniProgramFileRef) 不接受 root 自身 `'.'` 的文件引用 guard。
|
|
787
791
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 使用目录引用的公开路径操作代理。
|
|
792
|
+
* @since 0.8.0
|
|
788
793
|
*/
|
|
789
794
|
function isMiniProgramDirectoryRef(value) {
|
|
790
795
|
if (!isRecord$3(value) || value.kind !== 'directory')
|
|
@@ -859,6 +864,7 @@ function isMiniProgramDirectoryRef(value) {
|
|
|
859
864
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 校验后由 SDK 建立的文件代理。
|
|
860
865
|
* @see [PickFilesResult](/reference/symbols/protocol/types/PickFilesResult) picker 的 direct-ref 文件结果。
|
|
861
866
|
* @see [SaveFileResult](/reference/symbols/protocol/types/SaveFileResult) save picker 的 direct-ref 文件结果。
|
|
867
|
+
* @since 0.8.0
|
|
862
868
|
*/
|
|
863
869
|
function isMiniProgramFileDescriptor(value) {
|
|
864
870
|
return (isRecord$3(value) &&
|
|
@@ -929,6 +935,7 @@ function isMiniProgramFileDescriptor(value) {
|
|
|
929
935
|
* @see [FilesModule](/reference/symbols/root/interfaces/FilesModule) `files` 公开能力入口。
|
|
930
936
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 校验后由 SDK 建立的目录代理。
|
|
931
937
|
* @see [PickDirectoryResult](/reference/symbols/protocol/types/PickDirectoryResult) picker 的 direct-ref 返回契约。
|
|
938
|
+
* @since 0.8.0
|
|
932
939
|
*/
|
|
933
940
|
function isMiniProgramDirectoryDescriptor(value) {
|
|
934
941
|
return (isRecord$3(value) &&
|
|
@@ -994,6 +1001,7 @@ function isMiniProgramDirectoryDescriptor(value) {
|
|
|
994
1001
|
* @see [FileSystemEntity](/reference/symbols/root/types/FileSystemEntity) SDK 公开的 FileHandle/DirectoryHandle 联合。
|
|
995
1002
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 文件 descriptor 对应的能力代理。
|
|
996
1003
|
* @see [DirectoryHandle](/reference/symbols/root/interfaces/DirectoryHandle) 目录 descriptor 对应的能力代理及 `list()` 入口。
|
|
1004
|
+
* @since 0.8.0
|
|
997
1005
|
*/
|
|
998
1006
|
function isMiniProgramFileSystemEntityDescriptor(value) {
|
|
999
1007
|
return isMiniProgramFileDescriptor(value) || isMiniProgramDirectoryDescriptor(value);
|
|
@@ -1049,6 +1057,7 @@ function isMiniProgramFileSystemEntityDescriptor(value) {
|
|
|
1049
1057
|
* @see [CompanionStdio](/reference/symbols/root/interfaces/CompanionStdio) Companion 原始字节 stdin/stdout/stderr。
|
|
1050
1058
|
* @see [isMiniProgramFileDescriptor](/reference/symbols/protocol/functions/isMiniProgramFileDescriptor) 文件 descriptor guard。
|
|
1051
1059
|
* @see [isMiniProgramDirectoryDescriptor](/reference/symbols/protocol/functions/isMiniProgramDirectoryDescriptor) 目录 descriptor guard。
|
|
1060
|
+
* @since 0.8.0
|
|
1052
1061
|
*/
|
|
1053
1062
|
function isMiniProgramByteArray(value) {
|
|
1054
1063
|
return value instanceof Uint8Array && value.buffer instanceof ArrayBuffer;
|
|
@@ -1108,6 +1117,7 @@ function isMiniProgramByteArray(value) {
|
|
|
1108
1117
|
* @see [FileStatResult](/reference/symbols/protocol/types/FileStatResult) `file.stat` 的 wire 返回类型。
|
|
1109
1118
|
* @see [FileStat](/reference/symbols/root/interfaces/FileStat) SDK 向业务返回的元数据快照。
|
|
1110
1119
|
* @see [FileHandle](/reference/symbols/root/interfaces/FileHandle) 提供 `stat()` 的当前 session 文件代理。
|
|
1120
|
+
* @since 0.8.0
|
|
1111
1121
|
*/
|
|
1112
1122
|
function isMiniProgramFileStat(value) {
|
|
1113
1123
|
return (isRecord$3(value) &&
|
|
@@ -1168,6 +1178,7 @@ function isMiniProgramFileStat(value) {
|
|
|
1168
1178
|
* @see [DownloadProgress](/reference/symbols/root/interfaces/DownloadProgress) `onProgress` 接收的公开 SDK 进度类型。
|
|
1169
1179
|
* @see [network.download](/reference/sdk/network/download) 产生并消费该进度的下载能力。
|
|
1170
1180
|
* @see [isMiniProgramBridgeMessage](/reference/symbols/protocol/functions/isMiniProgramBridgeMessage) operation progress envelope 的最低校验。
|
|
1181
|
+
* @since 0.8.0
|
|
1171
1182
|
*/
|
|
1172
1183
|
function isMiniProgramDownloadProgressPayload(value) {
|
|
1173
1184
|
if (!isRecord$3(value) ||
|
|
@@ -1294,6 +1305,7 @@ const MANAGED_RUNTIME_PERMISSION_KEYS = new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
|
1294
1305
|
* @see [parseMiniProgramRuntimePermissions](/reference/symbols/protocol/functions/parseMiniProgramRuntimePermissions) 完整 snapshot 的 trim、legacy 归一化与 config 校验。
|
|
1295
1306
|
* @see [MINI_PROGRAM_PROTOCOL_CAPABILITIES](/reference/symbols/protocol/constants/MINI_PROGRAM_PROTOCOL_CAPABILITIES) method 到 permission requirement 的权威映射。
|
|
1296
1307
|
* @see [权限声明](/guide/permissions) Manifest 声明、平台批准与 Runtime 状态的完整流程。
|
|
1308
|
+
* @since 0.6.4
|
|
1297
1309
|
*/
|
|
1298
1310
|
function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
1299
1311
|
return MANAGED_RUNTIME_PERMISSION_KEYS.has(key);
|
|
@@ -1369,6 +1381,7 @@ function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
|
1369
1381
|
* @see {@link isManagedMiniProgramRuntimePermissionKey}
|
|
1370
1382
|
* @see {@link MINI_PROGRAM_PROTOCOL_CAPABILITIES}
|
|
1371
1383
|
* @see {@link https://docs.xiaoheihe.cn/hb_sdk/guide/permissions | 权限声明}
|
|
1384
|
+
* @since 0.6.4
|
|
1372
1385
|
*/
|
|
1373
1386
|
function parseMiniProgramRuntimePermissions(snapshot) {
|
|
1374
1387
|
if (!isRecord$2(snapshot) || snapshot.schema_version !== 1 || !Array.isArray(snapshot.entries)) {
|
package/dist/vite.cjs.js
CHANGED
|
@@ -10141,6 +10141,7 @@ const BASIC_INFO_MAX_PIXELS = 40_000_000;
|
|
|
10141
10141
|
* @returns NFKC 规范化、去除首尾 Unicode White_Space 后的名称;不折叠规范化后的内部空白。
|
|
10142
10142
|
* @throws `Error` 输入不是字符串,或规范化后不是 1–40 个 Unicode code point、不含文字或数字,或包含控制字符、
|
|
10143
10143
|
* 格式字符、行/段分隔符以及 HTML 特殊字符 `<`、`>`、`&`、双引号或单引号时抛出。
|
|
10144
|
+
* @since 0.8.2
|
|
10144
10145
|
*/
|
|
10145
10146
|
function normalizeBasicInfoName(raw) {
|
|
10146
10147
|
if (typeof raw !== 'string')
|
|
@@ -10172,6 +10173,7 @@ function validateBasicInfoPath(raw) {
|
|
|
10172
10173
|
* @remarks
|
|
10173
10174
|
* 图片路径必须使用 `/` 分隔的非空相对路径,扩展名为 JPEG、PNG、GIF 或 WebP;拒绝 URL、点段、
|
|
10174
10175
|
* 控制字符和构建/缓存等保留目录。此函数只校验声明,不读取文件,也不验证图片字节、尺寸或存在性。
|
|
10176
|
+
* @since 0.8.2
|
|
10175
10177
|
*/
|
|
10176
10178
|
function parseMiniappBasicInfo(value, sdkVersion = '0.8.2') {
|
|
10177
10179
|
sdkVersion = sdkVersion.trim();
|
|
@@ -10302,7 +10304,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
10302
10304
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
10303
10305
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
10304
10306
|
? undefined
|
|
10305
|
-
: '0.9.2
|
|
10307
|
+
: '0.9.2';
|
|
10306
10308
|
|
|
10307
10309
|
/**
|
|
10308
10310
|
* iframe 与调试台页面的开发期 console 捕获转发。
|
|
@@ -10675,6 +10677,7 @@ const MINIAPP_BIND_APP_IDS_MAX_COUNT = 20;
|
|
|
10675
10677
|
* @see [miniappManifest](/reference/symbols/vite/functions/miniappManifest)
|
|
10676
10678
|
* @see [navigation.openAppPage](/reference/sdk/navigation/openAppPage)
|
|
10677
10679
|
* @see [CLI 与远端发布](/guide/cli#生产构建)
|
|
10680
|
+
* @since 0.8.1
|
|
10678
10681
|
*/
|
|
10679
10682
|
function parseMiniappBindAppIds(value, options = {}) {
|
|
10680
10683
|
const sourceLabel = options.sourceLabel ?? 'package.json#heybox.bindAppIds';
|
|
@@ -10711,6 +10714,7 @@ function parseMiniappBindAppIds(value, options = {}) {
|
|
|
10711
10714
|
* @param sourceLabel - 错误消息中的字段来源,默认 `package.json#heybox.category`。
|
|
10712
10715
|
* @returns 合法类别原值;输入 `undefined` 时返回 `undefined`,由发布流程另行检查是否必填。
|
|
10713
10716
|
* @throws `Error` 输入为其他值(包括 null 或空字符串)时抛出带字段来源的错误。
|
|
10717
|
+
* @since 0.8.3
|
|
10714
10718
|
*/
|
|
10715
10719
|
function parseMiniappCategory(value, sourceLabel = 'package.json#heybox.category') {
|
|
10716
10720
|
if (value === undefined)
|
|
@@ -20658,6 +20662,7 @@ const devSnapshotStores = devSnapshotRegistry[devSnapshotStoreKey];
|
|
|
20658
20662
|
* @see [权限声明](/guide/permissions) `heybox.permissions` 严格 schema 与迁移规则。
|
|
20659
20663
|
* @see [窗口尺寸与可缩放性](/guide/window-size) `heybox.window` 字段与 Host 消费语义。
|
|
20660
20664
|
* @see [受管桌面程序](/guide/companion) Companion 声明、归档和本地联调边界。
|
|
20665
|
+
* @since 0.3.1
|
|
20661
20666
|
*/
|
|
20662
20667
|
function miniappManifest() {
|
|
20663
20668
|
const includeCompanions = process.env.HB_SDK_SKIP_COMPANIONS !== '1';
|
package/dist/vite.esm.js
CHANGED
|
@@ -10138,6 +10138,7 @@ const BASIC_INFO_MAX_PIXELS = 40_000_000;
|
|
|
10138
10138
|
* @returns NFKC 规范化、去除首尾 Unicode White_Space 后的名称;不折叠规范化后的内部空白。
|
|
10139
10139
|
* @throws `Error` 输入不是字符串,或规范化后不是 1–40 个 Unicode code point、不含文字或数字,或包含控制字符、
|
|
10140
10140
|
* 格式字符、行/段分隔符以及 HTML 特殊字符 `<`、`>`、`&`、双引号或单引号时抛出。
|
|
10141
|
+
* @since 0.8.2
|
|
10141
10142
|
*/
|
|
10142
10143
|
function normalizeBasicInfoName(raw) {
|
|
10143
10144
|
if (typeof raw !== 'string')
|
|
@@ -10169,6 +10170,7 @@ function validateBasicInfoPath(raw) {
|
|
|
10169
10170
|
* @remarks
|
|
10170
10171
|
* 图片路径必须使用 `/` 分隔的非空相对路径,扩展名为 JPEG、PNG、GIF 或 WebP;拒绝 URL、点段、
|
|
10171
10172
|
* 控制字符和构建/缓存等保留目录。此函数只校验声明,不读取文件,也不验证图片字节、尺寸或存在性。
|
|
10173
|
+
* @since 0.8.2
|
|
10172
10174
|
*/
|
|
10173
10175
|
function parseMiniappBasicInfo(value, sdkVersion = '0.8.2') {
|
|
10174
10176
|
sdkVersion = sdkVersion.trim();
|
|
@@ -10299,7 +10301,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
10299
10301
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
10300
10302
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
10301
10303
|
? undefined
|
|
10302
|
-
: '0.9.2
|
|
10304
|
+
: '0.9.2';
|
|
10303
10305
|
|
|
10304
10306
|
/**
|
|
10305
10307
|
* iframe 与调试台页面的开发期 console 捕获转发。
|
|
@@ -10672,6 +10674,7 @@ const MINIAPP_BIND_APP_IDS_MAX_COUNT = 20;
|
|
|
10672
10674
|
* @see [miniappManifest](/reference/symbols/vite/functions/miniappManifest)
|
|
10673
10675
|
* @see [navigation.openAppPage](/reference/sdk/navigation/openAppPage)
|
|
10674
10676
|
* @see [CLI 与远端发布](/guide/cli#生产构建)
|
|
10677
|
+
* @since 0.8.1
|
|
10675
10678
|
*/
|
|
10676
10679
|
function parseMiniappBindAppIds(value, options = {}) {
|
|
10677
10680
|
const sourceLabel = options.sourceLabel ?? 'package.json#heybox.bindAppIds';
|
|
@@ -10708,6 +10711,7 @@ function parseMiniappBindAppIds(value, options = {}) {
|
|
|
10708
10711
|
* @param sourceLabel - 错误消息中的字段来源,默认 `package.json#heybox.category`。
|
|
10709
10712
|
* @returns 合法类别原值;输入 `undefined` 时返回 `undefined`,由发布流程另行检查是否必填。
|
|
10710
10713
|
* @throws `Error` 输入为其他值(包括 null 或空字符串)时抛出带字段来源的错误。
|
|
10714
|
+
* @since 0.8.3
|
|
10711
10715
|
*/
|
|
10712
10716
|
function parseMiniappCategory(value, sourceLabel = 'package.json#heybox.category') {
|
|
10713
10717
|
if (value === undefined)
|
|
@@ -20655,6 +20659,7 @@ const devSnapshotStores = devSnapshotRegistry[devSnapshotStoreKey];
|
|
|
20655
20659
|
* @see [权限声明](/guide/permissions) `heybox.permissions` 严格 schema 与迁移规则。
|
|
20656
20660
|
* @see [窗口尺寸与可缩放性](/guide/window-size) `heybox.window` 字段与 Host 消费语义。
|
|
20657
20661
|
* @see [受管桌面程序](/guide/companion) Companion 声明、归档和本地联调边界。
|
|
20662
|
+
* @since 0.3.1
|
|
20658
20663
|
*/
|
|
20659
20664
|
function miniappManifest() {
|
|
20660
20665
|
const includeCompanions = process.env.HB_SDK_SKIP_COMPANIONS !== '1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heybox/hb-sdk",
|
|
3
|
-
"version": "0.9.2
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"./src/index.ts",
|
|
6
6
|
"./src/core/singleton.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"undici": "^7.28.0",
|
|
77
77
|
"ws": "^8.18.0",
|
|
78
78
|
"sharp": "^0.34.5",
|
|
79
|
-
"@heybox/hb-sdk-protocol": "0.9.2
|
|
79
|
+
"@heybox/hb-sdk-protocol": "0.9.2"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"vite": ">=5"
|
|
@@ -130,11 +130,11 @@
|
|
|
130
130
|
"rollup-plugin-dts": "6.4.0",
|
|
131
131
|
"@heybox-domain/heybox-theme": "~0.1.0",
|
|
132
132
|
"@heybox/hb-api": "~1.28.14",
|
|
133
|
-
"@heybox/hb-sdk-runtime": "~0.9.2
|
|
133
|
+
"@heybox/hb-sdk-runtime": "~0.9.2",
|
|
134
134
|
"@heybox-domain/heybox-vue3-ui": "~0.1.0",
|
|
135
|
+
"@heybox/runtime-policy": "~0.2.1",
|
|
135
136
|
"@heybox/runtime": "~0.2.1",
|
|
136
|
-
"@heybox/runtime-transport-fetch": "~0.2.1"
|
|
137
|
-
"@heybox/runtime-policy": "~0.2.1"
|
|
137
|
+
"@heybox/runtime-transport-fetch": "~0.2.1"
|
|
138
138
|
},
|
|
139
139
|
"publishConfig": {
|
|
140
140
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -187,6 +187,7 @@
|
|
|
187
187
|
"check:docs-sync": "pnpm --filter @heybox-docs/docs-hb_sdk run check:reference && node scripts/skill/generate-manifest.mjs --check && node scripts/skill/validate-skill.mjs",
|
|
188
188
|
"check:compatibility-evidence": "node scripts/validate-compatibility-evidence.mjs",
|
|
189
189
|
"check:api-semver": "node ../../ops/jobs/hb-sdk-docs-contract/semantic-diff.cjs",
|
|
190
|
+
"check:since-tags": "node scripts/verify-since-against-tags.mjs",
|
|
190
191
|
"clean": "rimraf ./dist && rimraf ./types",
|
|
191
192
|
"test:unit": "vitest run",
|
|
192
193
|
"test:types:characterization": "tsc -p tsconfig.characterization.json --noEmit --pretty false",
|
package/skill/skill.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.9.2
|
|
3
|
+
"skillVersion": "0.9.2+skill.4d7b063940c3",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.9.2
|
|
7
|
-
"compatibility": "0.9.2
|
|
6
|
+
"version": "0.9.2",
|
|
7
|
+
"compatibility": "0.9.2"
|
|
8
8
|
},
|
|
9
9
|
"distribution": {
|
|
10
10
|
"type": "npm",
|
|
11
11
|
"package": "@heybox/hb-sdk",
|
|
12
|
-
"version": "0.9.2
|
|
12
|
+
"version": "0.9.2",
|
|
13
13
|
"path": "skill"
|
|
14
14
|
},
|
|
15
15
|
"integrity": "sha256-4d7b063940c341502cf34c481b656be96ac27f1a252055b2b1af445c6392264c"
|
|
@@ -3651,6 +3651,11 @@ interface WorkspaceCardsControllerAuthoring {
|
|
|
3651
3651
|
actions?: Readonly<Record<string, WorkspaceCardActionHandle>>;
|
|
3652
3652
|
refresh?: WorkspaceCardController['refresh'];
|
|
3653
3653
|
}
|
|
3654
|
+
/**
|
|
3655
|
+
* 工作区卡片定义入口。
|
|
3656
|
+
*
|
|
3657
|
+
* @since 0.9.1
|
|
3658
|
+
*/
|
|
3654
3659
|
declare function defineCard<T extends WorkspaceCardAuthorDefinition>(definition: T): T;
|
|
3655
3660
|
declare const actionInput: {
|
|
3656
3661
|
readonly string: (options?: {
|
|
@@ -3663,19 +3668,46 @@ declare const actionInput: {
|
|
|
3663
3668
|
}) => WorkspaceCardActionInputSchema;
|
|
3664
3669
|
readonly object: (properties: Readonly<Record<string, WorkspaceCardActionInputSchema>>) => WorkspaceCardActionInputSchema;
|
|
3665
3670
|
};
|
|
3671
|
+
/**
|
|
3672
|
+
* 工作区卡片 action 定义入口。
|
|
3673
|
+
*
|
|
3674
|
+
* @since 0.9.1
|
|
3675
|
+
*/
|
|
3666
3676
|
declare function defineAction<Input extends WorkspaceCardJson>(definition: {
|
|
3667
3677
|
input?: WorkspaceCardActionInputSchema;
|
|
3668
3678
|
run(ctx: WorkspaceCardControllerContext, input: Input): WorkspaceCardControllerResult | Promise<WorkspaceCardControllerResult>;
|
|
3669
3679
|
}): WorkspaceCardActionHandle<Input>;
|
|
3680
|
+
/**
|
|
3681
|
+
* 打开小程序 action 定义入口。
|
|
3682
|
+
*
|
|
3683
|
+
* @since 0.9.1
|
|
3684
|
+
*/
|
|
3670
3685
|
declare function defineOpenMiniProgramAction<Input extends WorkspaceCardJson = WorkspaceCardJson>(options?: {
|
|
3671
3686
|
input?: WorkspaceCardActionInputSchema;
|
|
3672
3687
|
}): WorkspaceCardActionHandle<Input>;
|
|
3688
|
+
/**
|
|
3689
|
+
* 工作区卡片控制器定义入口。
|
|
3690
|
+
*
|
|
3691
|
+
* @since 0.9.1
|
|
3692
|
+
*/
|
|
3673
3693
|
declare function defineWorkspaceCardsController<T extends WorkspaceCardsControllerAuthoring>(controller: T): T;
|
|
3674
|
-
/**
|
|
3694
|
+
/**
|
|
3695
|
+
* 定义控制器;构建器和 Host 分别验证静态 action 表。
|
|
3696
|
+
*
|
|
3697
|
+
* @since 0.9.1
|
|
3698
|
+
*/
|
|
3675
3699
|
declare function defineWorkspaceCardController<T extends WorkspaceCardController>(controller: T): T;
|
|
3676
|
-
/**
|
|
3700
|
+
/**
|
|
3701
|
+
* 生成固定受管 invoke 入口;身份由 Host 根据真实卡片绑定。
|
|
3702
|
+
*
|
|
3703
|
+
* @since 0.9.1
|
|
3704
|
+
*/
|
|
3677
3705
|
declare function invoke(actionId: string, params?: WorkspaceCardJson): ViewAction;
|
|
3678
|
-
/**
|
|
3706
|
+
/**
|
|
3707
|
+
* 只允许打开当前小程序。
|
|
3708
|
+
*
|
|
3709
|
+
* @since 0.9.1
|
|
3710
|
+
*/
|
|
3679
3711
|
declare function openMiniProgram(actionId: string, params?: WorkspaceCardJson): ViewAction;
|
|
3680
3712
|
|
|
3681
3713
|
export { actionInput, badge, barChart, button, carousel, defineAction, defineCard, defineOpenMiniProgramAction, defineWorkspaceCardController, defineWorkspaceCardsController, divider, expandable, fields, frame, grid, group, hstack, icon, image, invoke, list, meter, openMiniProgram, radialProgress, region, renderer, spacer, tabs, text, textField, toggle, viewDocument, vstack, zstack };
|