@heybox/hb-sdk 0.9.9-alpha.0 → 0.9.9-alpha.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 +16 -0
- package/README.md +2 -0
- package/dist/cli-chunks/{build-Vi5Zyplz.cjs → build-BlDpuz8v.cjs} +5 -5
- package/dist/cli-chunks/{create-Cfz1IcYf.cjs → create-BQbqb-ph.cjs} +2 -2
- package/dist/cli-chunks/{dev-C2dtgF42.cjs → dev-U8fYtFNt.cjs} +15 -10
- package/dist/cli-chunks/{doctor-D-zMCLIA.cjs → doctor-CGJfat87.cjs} +1 -1
- package/dist/cli-chunks/{game-binding-guide-z3X6h8ck.cjs → game-binding-guide-C0fNljyC.cjs} +3 -3
- package/dist/cli-chunks/{game-bindings-DiVP8PdD.cjs → game-bindings-Dun_g-3H.cjs} +4 -4
- package/dist/cli-chunks/{games-THhcga6y.cjs → games-C6qjqKus.cjs} +1 -1
- package/dist/cli-chunks/{index-BuYCoach.cjs → index-D9duvEkQ.cjs} +1 -1
- package/dist/cli-chunks/{index-H9U6-mLY.cjs → index-DcyYtbXh.cjs} +40 -25
- package/dist/cli-chunks/{index.esm-XiyiK7eH.cjs → index.esm-CdNQ_kHI.cjs} +9 -9
- package/dist/cli-chunks/{index.esm-D8lqHXUQ.cjs → index.esm-CenYK5Bl.cjs} +72 -3
- package/dist/cli-chunks/{login-Bw_1UJ8i.cjs → login-P7RtNdwf.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-CFfq-fV7.cjs → project-vite-BH7q_pzh.cjs} +1 -1
- package/dist/cli-chunks/{remote-CU88U8t8.cjs → remote-D39sRE7v.cjs} +142 -26
- package/dist/cli-chunks/{runtime-permission-env-BtxzR-dv.cjs → runtime-permission-env-CZNyFKnx.cjs} +24 -4
- package/dist/cli-chunks/{skill-7RZJxGDO.cjs → skill-Dm6lUW7l.cjs} +2 -2
- package/dist/cli-chunks/{version-COTSItDf.cjs → version-7t_EYjo_.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-D52x803m.js +224 -0
- package/dist/devtools/browser-dev-host/assets/{desktop-app-launch-az2quV7I.js → desktop-app-launch-BNPRuxe6.js} +1 -1
- package/dist/devtools/browser-dev-host/assets/{index-o5r5oqtq.js → index-t_066TMb.js} +3 -3
- package/dist/devtools/browser-dev-host/index.html +2 -2
- package/dist/index.cjs.js +149 -4
- package/dist/index.esm.js +149 -5
- package/dist/miniapp-publish.cjs.js +64 -1
- package/dist/miniapp-publish.esm.js +63 -2
- package/dist/protocol.cjs.js +51 -5
- package/dist/protocol.esm.js +51 -5
- package/dist/vite.cjs.js +59 -2
- package/dist/vite.esm.js +59 -2
- package/package.json +7 -7
- package/skill/skill.json +4 -4
- package/types/index.d.ts +140 -4
- package/types/miniapp-publish/index.d.ts +14 -3
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-CHdD15qt.js +0 -221
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
本文件随 `@heybox/hb-sdk` npm 包公开分发,只记录外部小程序开发者可观察到的变化。
|
|
4
4
|
|
|
5
|
+
## 0.9.9-alpha.2 - 2026-11-16
|
|
6
|
+
|
|
7
|
+
### 文档与工具
|
|
8
|
+
|
|
9
|
+
- [关联帖子](https://docs.xiaoheihe.cn/hb_sdk/guide/linked-post)的 CLI 预览与绑定命令支持直接输入 App 分享链接或官网帖子链接,帖子标识由平台校验。
|
|
10
|
+
|
|
11
|
+
### 问题修复
|
|
12
|
+
|
|
13
|
+
- 修复 Android 宿主中帖子点赞、取消点赞以及评论点赞、取消点赞和删除的请求参数传递,需配套更新 Runtime 宿主。
|
|
14
|
+
|
|
15
|
+
## 0.9.9-alpha.1 - 2026-11-14
|
|
16
|
+
|
|
17
|
+
### 新增能力
|
|
18
|
+
|
|
19
|
+
- 新增[关联帖子](https://docs.xiaoheihe.cn/hb_sdk/guide/linked-post)能力,支持读取图文帖、评论与回复,拉起社区原生编辑器发表评论和回复,以及点赞、收藏和删除评论。开发者可通过 CLI 管理绑定;使用 `post` 权限中的 `read` / `write` 分别声明读取与互动,需配套 Host 与平台服务。
|
|
20
|
+
|
|
5
21
|
## 0.9.9-alpha.0 - 2026-11-14
|
|
6
22
|
|
|
7
23
|
### 文档与工具
|
package/README.md
CHANGED
|
@@ -81,3 +81,5 @@ Agent Skill 随 SDK 提供,使用时联网读取 [llms.txt](https://docs.xiaoh
|
|
|
81
81
|
## DOM 截图
|
|
82
82
|
|
|
83
83
|
`share.screenshotElement({ element, ...options })` 保持与原截图相同的水印、延迟、相册和社区分享选项。普通元素截取窗口区域,长元素由配套的 iOS / Android Host 自动生成长图;旧宿主会拒绝。完整范围与限制见[DOM 截图说明](https://docs.xiaoheihe.cn/hb_sdk/recipes/community-share#按-dom-元素截图)。
|
|
84
|
+
|
|
85
|
+
关联图文帖的读取、评论和互动见[关联帖子指南](https://docs.xiaoheihe.cn/hb_sdk/guide/linked-post)。
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var fs = require('node:fs/promises');
|
|
4
4
|
var path = require('node:path');
|
|
5
|
-
var runtimePermissionEnv = require('./runtime-permission-env-
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
require('./index.esm-
|
|
5
|
+
var runtimePermissionEnv = require('./runtime-permission-env-CZNyFKnx.cjs');
|
|
6
|
+
var index = require('./index-DcyYtbXh.cjs');
|
|
7
|
+
require('./index.esm-CenYK5Bl.cjs');
|
|
8
8
|
require('node:crypto');
|
|
9
9
|
require('node:fs');
|
|
10
10
|
require('node:zlib');
|
|
11
|
-
var projectVite = require('./project-vite-
|
|
12
|
-
require('./version-
|
|
11
|
+
var projectVite = require('./project-vite-BH7q_pzh.cjs');
|
|
12
|
+
require('./version-7t_EYjo_.cjs');
|
|
13
13
|
require('./bindings-B9HSKhmy.cjs');
|
|
14
14
|
require('node:module');
|
|
15
15
|
require('node:url');
|
|
@@ -5,8 +5,8 @@ var fs = require('node:fs/promises');
|
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var require$$0 = require('fs');
|
|
7
7
|
var require$$1 = require('path');
|
|
8
|
-
var index = require('./index-
|
|
9
|
-
var index_esm = require('./index.esm-
|
|
8
|
+
var index = require('./index-DcyYtbXh.cjs');
|
|
9
|
+
var index_esm = require('./index.esm-CenYK5Bl.cjs');
|
|
10
10
|
require('node:module');
|
|
11
11
|
require('readline');
|
|
12
12
|
require('os');
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var gameBindingGuide = require('./game-binding-guide-
|
|
3
|
+
var gameBindingGuide = require('./game-binding-guide-C0fNljyC.cjs');
|
|
4
4
|
var fs = require('node:fs/promises');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
-
var remote = require('./remote-
|
|
7
|
-
var index = require('./index-
|
|
6
|
+
var remote = require('./remote-D39sRE7v.cjs');
|
|
7
|
+
var index = require('./index-DcyYtbXh.cjs');
|
|
8
8
|
var node_crypto = require('node:crypto');
|
|
9
9
|
var fs$1 = require('node:fs');
|
|
10
|
-
var index_esm = require('./index.esm-
|
|
11
|
-
var version = require('./version-
|
|
12
|
-
var runtimePermissionEnv = require('./runtime-permission-env-
|
|
10
|
+
var index_esm = require('./index.esm-CenYK5Bl.cjs');
|
|
11
|
+
var version = require('./version-7t_EYjo_.cjs');
|
|
12
|
+
var runtimePermissionEnv = require('./runtime-permission-env-CZNyFKnx.cjs');
|
|
13
13
|
require('node:zlib');
|
|
14
14
|
var os = require('node:os');
|
|
15
15
|
var net = require('node:net');
|
|
@@ -31,7 +31,7 @@ var require$$0$2 = require('stream');
|
|
|
31
31
|
var require$$0$3 = require('url');
|
|
32
32
|
var require$$5 = require('zlib');
|
|
33
33
|
var require$$1 = require('util');
|
|
34
|
-
var projectVite = require('./project-vite-
|
|
34
|
+
var projectVite = require('./project-vite-BH7q_pzh.cjs');
|
|
35
35
|
|
|
36
36
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
37
37
|
const BROWSER_DEV_HOST_JSON_BODY_LIMIT = 1024 * 1024;
|
|
@@ -3467,8 +3467,8 @@ const DEFAULT_CHANNEL_TRANSPORT = {
|
|
|
3467
3467
|
};
|
|
3468
3468
|
const IPV4_LOOPBACK_ADDRESSES = new net.BlockList();
|
|
3469
3469
|
IPV4_LOOPBACK_ADDRESSES.addSubnet('127.0.0.0', 8, 'ipv4');
|
|
3470
|
-
const { WebSocket: WebSocket$1, WebSocketServer: WebSocketServer$1 } = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/dev-
|
|
3471
|
-
const { parse: parseHtml } = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/dev-
|
|
3470
|
+
const { WebSocket: WebSocket$1, WebSocketServer: WebSocketServer$1 } = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/dev-U8fYtFNt.cjs', document.baseURI).href)))('ws');
|
|
3471
|
+
const { parse: parseHtml } = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/dev-U8fYtFNt.cjs', document.baseURI).href)))('parse5');
|
|
3472
3472
|
const BROWSER_DEV_HOST_ROOT_CANDIDATES = [
|
|
3473
3473
|
path.resolve(__dirname, 'devtools/browser-dev-host'),
|
|
3474
3474
|
path.resolve(__dirname, '../devtools/browser-dev-host'),
|
|
@@ -12909,7 +12909,7 @@ function assertNodeRuntimeCapabilities(ctx, settings) {
|
|
|
12909
12909
|
function createNodeRealtimeDriverRegistry() {
|
|
12910
12910
|
const registry = createRuntimeRealtimeDriverRegistry();
|
|
12911
12911
|
registry.registerLazy('node-websocket', async () => {
|
|
12912
|
-
const mod = await Promise.resolve().then(function () { return require('./index.esm-
|
|
12912
|
+
const mod = await Promise.resolve().then(function () { return require('./index.esm-CdNQ_kHI.cjs'); });
|
|
12913
12913
|
return mod.createNodeWebSocketRuntimeDriver();
|
|
12914
12914
|
});
|
|
12915
12915
|
return registry;
|
|
@@ -16931,6 +16931,10 @@ async function executeCliHeyboxAuthenticatedRequest(runtime, session, request, s
|
|
|
16931
16931
|
throw new BrowserDevSessionError(400, 'INVALID_AUTHENTICATED_REQUEST', 'heybox-api path 不合法');
|
|
16932
16932
|
}
|
|
16933
16933
|
const credentials = request.credentials ?? 'heybox-session';
|
|
16934
|
+
if (request.security !== undefined &&
|
|
16935
|
+
(!isRecord$2(request.security) || Object.keys(request.security).length !== 1 || request.security.rnd !== '15')) {
|
|
16936
|
+
throw new BrowserDevSessionError(400, 'INVALID_AUTHENTICATED_REQUEST', '不支持的请求签名要求');
|
|
16937
|
+
}
|
|
16934
16938
|
const method = (request.method ?? 'GET').toUpperCase();
|
|
16935
16939
|
const serviceTag = index.resolveHeyboxRylaiServiceTag(path);
|
|
16936
16940
|
const headers = {
|
|
@@ -16950,6 +16954,7 @@ async function executeCliHeyboxAuthenticatedRequest(runtime, session, request, s
|
|
|
16950
16954
|
...(request.bodyEncoding === undefined ? {} : { bodyEncoding: request.bodyEncoding }),
|
|
16951
16955
|
channel: request.target.channel ?? 'api',
|
|
16952
16956
|
failurePresentation: 'none',
|
|
16957
|
+
...(request.security === undefined ? {} : { security: request.security }),
|
|
16953
16958
|
headers,
|
|
16954
16959
|
method: method,
|
|
16955
16960
|
query: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DcyYtbXh.cjs');
|
|
4
4
|
var promises = require('node:readline/promises');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
6
|
var fs = require('node:fs/promises');
|
|
7
|
-
var index_esm = require('./index.esm-
|
|
7
|
+
var index_esm = require('./index.esm-CenYK5Bl.cjs');
|
|
8
8
|
var bindings = require('./bindings-B9HSKhmy.cjs');
|
|
9
9
|
var fs$1 = require('node:fs');
|
|
10
10
|
var path = require('node:path');
|
|
11
|
-
var games = require('./games-
|
|
11
|
+
var games = require('./games-C6qjqKus.cjs');
|
|
12
12
|
|
|
13
13
|
class MiniProgramProjectBindingError extends Error {
|
|
14
14
|
code;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var gameBindingGuide = require('./game-binding-guide-
|
|
4
|
-
var index = require('./index-
|
|
3
|
+
var gameBindingGuide = require('./game-binding-guide-C0fNljyC.cjs');
|
|
4
|
+
var index = require('./index-DcyYtbXh.cjs');
|
|
5
5
|
require('node:readline/promises');
|
|
6
6
|
require('node:crypto');
|
|
7
7
|
require('node:fs/promises');
|
|
8
|
-
require('./index.esm-
|
|
8
|
+
require('./index.esm-CenYK5Bl.cjs');
|
|
9
9
|
require('./bindings-B9HSKhmy.cjs');
|
|
10
10
|
require('node:fs');
|
|
11
11
|
require('node:path');
|
|
12
|
-
require('./games-
|
|
12
|
+
require('./games-C6qjqKus.cjs');
|
|
13
13
|
require('node:module');
|
|
14
14
|
require('readline');
|
|
15
15
|
require('os');
|
|
@@ -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-DcyYtbXh.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-DcyYtbXh.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-DcyYtbXh.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-DcyYtbXh.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-DcyYtbXh.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-DcyYtbXh.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-D9duvEkQ.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.9-alpha.
|
|
21938
|
+
const BUILT_CLI_VERSION = '0.9.9-alpha.2';
|
|
21939
21939
|
const PACKAGE_JSON_CANDIDATES$1 = [
|
|
21940
21940
|
path.resolve(__dirname, '..', '..', 'package.json'),
|
|
21941
21941
|
path.resolve(__dirname, '..', 'package.json'),
|
|
@@ -23035,7 +23035,10 @@ function createCliProgram(overrides = {}) {
|
|
|
23035
23035
|
.command('dev')
|
|
23036
23036
|
.description('启动当前小程序项目的 Vite 开发服务器和浏览器调试页服务')
|
|
23037
23037
|
.addOption(new Option('--browser <browser>', '预览使用的本机浏览器').choices(['chrome', 'edge']))
|
|
23038
|
-
.addOption(new Option('--browser-mode <mode>', '默认 auto:复用项目独立浏览器,否则请求日常浏览器授权后回退;isolated 使用独立环境').choices([
|
|
23038
|
+
.addOption(new Option('--browser-mode <mode>', '默认 auto:复用项目独立浏览器,否则请求日常浏览器授权后回退;isolated 使用独立环境').choices([
|
|
23039
|
+
'auto',
|
|
23040
|
+
'isolated',
|
|
23041
|
+
]))
|
|
23039
23042
|
.option('--port <port>', '小程序开发服务器端口', parsePositivePort)
|
|
23040
23043
|
.option('--browser-dev-host-port <port>', '浏览器调试页服务端口', parsePositivePort)
|
|
23041
23044
|
.option('--no-open', '不自动打开浏览器调试页')
|
|
@@ -23048,8 +23051,8 @@ function createCliProgram(overrides = {}) {
|
|
|
23048
23051
|
applyDevServiceTag(options?.serviceTag);
|
|
23049
23052
|
await handlers.runDevCommand(options, { logger });
|
|
23050
23053
|
}, handlers.printUpdateReminder, resolveLogger));
|
|
23051
|
-
installDevToolCommands(program.commands.find(command => command.name() === 'dev'));
|
|
23052
|
-
installDevPreviewCommands(program.commands.find(command => command.name() === 'dev'));
|
|
23054
|
+
installDevToolCommands(program.commands.find((command) => command.name() === 'dev'));
|
|
23055
|
+
installDevPreviewCommands(program.commands.find((command) => command.name() === 'dev'));
|
|
23053
23056
|
addVerboseOption(program.command('build').description('构建当前小程序项目')
|
|
23054
23057
|
.option('--env <name>', '加载项目根下 .env.<name> 预设并作为 Vite mode')
|
|
23055
23058
|
// 根程序开启位置化解析后,子命令必须自己声明同名选项才能拿到它;这里声明但不展示,
|
|
@@ -23125,12 +23128,13 @@ function addRemotePublicOptions(command) {
|
|
|
23125
23128
|
function installRemoteCommands(program, handlers, resolveLogger) {
|
|
23126
23129
|
const remote = addRemotePublicOptions(program.command('remote').description('管理当前项目绑定的远程 Heybox 工坊小程序'));
|
|
23127
23130
|
const games = addVerboseOption(remote.command('games').description('查询平台游戏信息'));
|
|
23128
|
-
addVerboseOption(games
|
|
23131
|
+
addVerboseOption(games
|
|
23132
|
+
.command('search')
|
|
23133
|
+
.description('按名称查找游戏 appid,不修改绑定')
|
|
23129
23134
|
.argument('<query>', '中文或英文游戏名')
|
|
23130
23135
|
.option('--offset <offset>', '结果偏移量,0–10000', '0')
|
|
23131
23136
|
.option('--limit <limit>', '每页数量,1–20', '10')
|
|
23132
|
-
.option('--json', '输出 JSON'))
|
|
23133
|
-
.action(async (query, _options, command) => {
|
|
23137
|
+
.option('--json', '输出 JSON')).action(async (query, _options, command) => {
|
|
23134
23138
|
const options = readCommandOptionsWithAncestors(command);
|
|
23135
23139
|
await handlers.runGameSearchCommand(query, {
|
|
23136
23140
|
offset: readStringOption(options.offset),
|
|
@@ -23175,9 +23179,20 @@ function installRemoteCommands(program, handlers, resolveLogger) {
|
|
|
23175
23179
|
miniProgramId: readStringArgument(miniProgramId, 'mini-program-id'),
|
|
23176
23180
|
})));
|
|
23177
23181
|
addRemotePublicOptions(remote.command('info').description('查看当前绑定的远程工坊小程序详情')).action(createRemoteAction(handlers, resolveLogger, 'info'));
|
|
23182
|
+
const post = addRemotePublicOptions(remote.command('post').description('管理小程序关联帖子;每个小程序最多关联一篇自己的公开帖子'));
|
|
23183
|
+
addRemotePublicOptions(post.command('get').description('查看当前关联帖子')).action(createRemoteAction(handlers, resolveLogger, 'post:get'));
|
|
23184
|
+
addRemotePublicOptions(post.command('preview').description('校验并预览待关联的帖子').argument('<post-id-or-url>', '帖子 ID 或小黑盒帖子链接')).action(createRemoteAction(handlers, resolveLogger, 'post:preview', (_command, postId) => ({
|
|
23185
|
+
postId: readStringArgument(postId, 'post-id'),
|
|
23186
|
+
})));
|
|
23187
|
+
addRemotePublicOptions(post.command('bind').description('关联或更换帖子').argument('<post-id-or-url>', '帖子 ID 或小黑盒帖子链接')).action(createRemoteAction(handlers, resolveLogger, 'post:bind', (_command, postId) => ({
|
|
23188
|
+
postId: readStringArgument(postId, 'post-id'),
|
|
23189
|
+
})));
|
|
23190
|
+
addRemotePublicOptions(post.command('unbind').description('解除当前帖子关联')).action(createRemoteAction(handlers, resolveLogger, 'post:unbind'));
|
|
23178
23191
|
const permission = addRemotePublicOptions(remote.command('permission').description('申请平台权限并查看审核状态'));
|
|
23179
23192
|
addRemotePublicOptions(permission.command('list').description('查看平台权限及最近申请状态')).action(createRemoteAction(handlers, resolveLogger, 'permission:list'));
|
|
23180
|
-
addRemotePublicOptions(permission
|
|
23193
|
+
addRemotePublicOptions(permission
|
|
23194
|
+
.command('apply')
|
|
23195
|
+
.description('提交平台权限申请')
|
|
23181
23196
|
.argument('<key>', 'network、companion 或 appProtocol;user_game_data 是声明型权限,无需申请')
|
|
23182
23197
|
.requiredOption('--reason <text>', '申请理由,不超过 500 字')
|
|
23183
23198
|
.option('--domains <domains>', 'network 访问域名,多个用逗号分隔')).action(createRemoteAction(handlers, resolveLogger, 'permission:apply', (command, key) => {
|
|
@@ -23358,39 +23373,39 @@ function createCommandLoggerResolver(options) {
|
|
|
23358
23373
|
};
|
|
23359
23374
|
}
|
|
23360
23375
|
const defaultClearLoginStatus = async (...args) => {
|
|
23361
|
-
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
23376
|
+
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-P7RtNdwf.cjs'); });
|
|
23362
23377
|
return clearLoginStatus(...args);
|
|
23363
23378
|
};
|
|
23364
23379
|
const defaultLoginToHeybox = async (...args) => {
|
|
23365
|
-
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-
|
|
23380
|
+
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-P7RtNdwf.cjs'); });
|
|
23366
23381
|
return loginToHeybox(...args);
|
|
23367
23382
|
};
|
|
23368
23383
|
const defaultPrintLoginStatus = async (...args) => {
|
|
23369
|
-
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
23384
|
+
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-P7RtNdwf.cjs'); });
|
|
23370
23385
|
return printLoginStatus(...args);
|
|
23371
23386
|
};
|
|
23372
23387
|
const defaultRunBuildCommand = async (...args) => {
|
|
23373
|
-
const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-
|
|
23388
|
+
const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-BlDpuz8v.cjs'); });
|
|
23374
23389
|
return runBuildCommand(...args);
|
|
23375
23390
|
};
|
|
23376
23391
|
const defaultRunCreateCommand = async (...args) => {
|
|
23377
|
-
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-
|
|
23392
|
+
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-BQbqb-ph.cjs'); });
|
|
23378
23393
|
return runCreateCommand(...args);
|
|
23379
23394
|
};
|
|
23380
23395
|
const defaultRunDevCommand = async (...args) => {
|
|
23381
|
-
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-
|
|
23396
|
+
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-U8fYtFNt.cjs'); }).then(function (n) { return n.dev; });
|
|
23382
23397
|
return runDevCommand(...args);
|
|
23383
23398
|
};
|
|
23384
23399
|
const defaultRunDoctorCommand = async (...args) => {
|
|
23385
|
-
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-
|
|
23400
|
+
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-CGJfat87.cjs'); });
|
|
23386
23401
|
return runDoctorCommand(...args);
|
|
23387
23402
|
};
|
|
23388
23403
|
const defaultRunSkillInstallCommand = async (...args) => {
|
|
23389
|
-
const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-
|
|
23404
|
+
const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-Dm6lUW7l.cjs'); });
|
|
23390
23405
|
return runSkillInstallCommand(...args);
|
|
23391
23406
|
};
|
|
23392
23407
|
const defaultRunRemoteCommand = async (...args) => {
|
|
23393
|
-
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-
|
|
23408
|
+
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-D39sRE7v.cjs'); }).then(function (n) { return n.remote; });
|
|
23394
23409
|
return runRemoteCommand(...args);
|
|
23395
23410
|
};
|
|
23396
23411
|
function resolveStandaloneLogger(options, verbose) {
|
|
@@ -23516,11 +23531,11 @@ function parseNonNegativeInteger(value) {
|
|
|
23516
23531
|
return parsed;
|
|
23517
23532
|
}
|
|
23518
23533
|
const defaultRunGameSearchCommand = async (...args) => {
|
|
23519
|
-
const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-
|
|
23534
|
+
const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-C6qjqKus.cjs'); });
|
|
23520
23535
|
return runGameSearchCommand(...args);
|
|
23521
23536
|
};
|
|
23522
23537
|
const defaultRunConfigureGameBindingsCommand = async (...args) => {
|
|
23523
|
-
const { runConfigureGameBindingsCommand } = await Promise.resolve().then(function () { return require('./game-bindings-
|
|
23538
|
+
const { runConfigureGameBindingsCommand } = await Promise.resolve().then(function () { return require('./game-bindings-Dun_g-3H.cjs'); });
|
|
23524
23539
|
return runConfigureGameBindingsCommand(...args);
|
|
23525
23540
|
};
|
|
23526
23541
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dev = require('./dev-
|
|
4
|
-
require('./game-binding-guide-
|
|
5
|
-
require('./index-
|
|
3
|
+
var dev = require('./dev-U8fYtFNt.cjs');
|
|
4
|
+
require('./game-binding-guide-C0fNljyC.cjs');
|
|
5
|
+
require('./index-DcyYtbXh.cjs');
|
|
6
6
|
require('node:module');
|
|
7
7
|
require('readline');
|
|
8
8
|
require('os');
|
|
@@ -24,12 +24,12 @@ require('node:child_process');
|
|
|
24
24
|
require('node:util');
|
|
25
25
|
require('node:readline/promises');
|
|
26
26
|
require('node:timers/promises');
|
|
27
|
-
require('./index.esm-
|
|
27
|
+
require('./index.esm-CenYK5Bl.cjs');
|
|
28
28
|
require('./bindings-B9HSKhmy.cjs');
|
|
29
|
-
require('./games-
|
|
30
|
-
require('./remote-
|
|
31
|
-
require('./runtime-permission-env-
|
|
32
|
-
require('./version-
|
|
29
|
+
require('./games-C6qjqKus.cjs');
|
|
30
|
+
require('./remote-D39sRE7v.cjs');
|
|
31
|
+
require('./runtime-permission-env-CZNyFKnx.cjs');
|
|
32
|
+
require('./version-7t_EYjo_.cjs');
|
|
33
33
|
require('node:url');
|
|
34
34
|
require('./_commonjs-dynamic-modules-DUamuDzp.cjs');
|
|
35
35
|
require('inspector');
|
|
@@ -51,7 +51,7 @@ require('net');
|
|
|
51
51
|
require('tls');
|
|
52
52
|
require('url');
|
|
53
53
|
require('zlib');
|
|
54
|
-
require('./project-vite-
|
|
54
|
+
require('./project-vite-BH7q_pzh.cjs');
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* @packageDocumentation
|
|
@@ -7,6 +7,19 @@
|
|
|
7
7
|
* 并在 origin 可以固定且协议模式要求时校验 origin。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
const POST_READ_METHODS = [
|
|
11
|
+
'post.get',
|
|
12
|
+
'post.comments.list',
|
|
13
|
+
'post.watch',
|
|
14
|
+
];
|
|
15
|
+
const POST_WRITE_METHODS = [
|
|
16
|
+
'post.setLiked',
|
|
17
|
+
'post.setFavorited',
|
|
18
|
+
'post.comments.openEditor',
|
|
19
|
+
'post.comments.delete',
|
|
20
|
+
'post.comments.setLiked',
|
|
21
|
+
];
|
|
22
|
+
|
|
10
23
|
/** 游戏资料内部 wire:业务方法由 SDK 映射为精确资源请求。 */
|
|
11
24
|
const USER_GAMES_GET_OVERVIEW_METHOD = 'user.games.getOverview';
|
|
12
25
|
const USER_DATA_QUERY_METHOD = 'user.data.query';
|
|
@@ -117,6 +130,20 @@ const COMPANION_SHOW_NOTIFICATION_METHOD = 'companion.showNotification';
|
|
|
117
130
|
* 仅表示无需 Manifest 权限声明,不表示绕过参数校验、Host 能力、可信手势或业务策略。
|
|
118
131
|
*/
|
|
119
132
|
[
|
|
133
|
+
...POST_READ_METHODS.map((method) => ({
|
|
134
|
+
method,
|
|
135
|
+
module: 'post',
|
|
136
|
+
capability: method,
|
|
137
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
138
|
+
risk: 'medium',
|
|
139
|
+
})),
|
|
140
|
+
...POST_WRITE_METHODS.map((method) => ({
|
|
141
|
+
method,
|
|
142
|
+
module: 'post',
|
|
143
|
+
capability: method,
|
|
144
|
+
requirement: { kind: 'all', permissions: ['post'] },
|
|
145
|
+
risk: 'high',
|
|
146
|
+
})),
|
|
120
147
|
...[GAME_SAVES_LIST_METHOD, GAME_SAVES_SYNC_METHOD, GAME_SAVES_GET_FILE_METHOD, GAME_SAVES_READ_PARSED_DATA_METHOD].map((method) => ({
|
|
121
148
|
method,
|
|
122
149
|
module: 'gameSaves',
|
|
@@ -209,7 +236,13 @@ const COMPANION_SHOW_NOTIFICATION_METHOD = 'companion.showNotification';
|
|
|
209
236
|
requirement: { kind: 'all', permissions: ['share'] },
|
|
210
237
|
risk: 'medium',
|
|
211
238
|
},
|
|
212
|
-
{
|
|
239
|
+
{
|
|
240
|
+
method: SHARE_SCREENSHOT_LONG_METHOD,
|
|
241
|
+
module: 'share',
|
|
242
|
+
capability: SHARE_SCREENSHOT_LONG_METHOD,
|
|
243
|
+
requirement: { kind: 'all', permissions: ['share'] },
|
|
244
|
+
risk: 'medium',
|
|
245
|
+
},
|
|
213
246
|
{
|
|
214
247
|
method: VIEWPORT_GET_WINDOW_INFO_METHOD,
|
|
215
248
|
module: 'viewport',
|
|
@@ -688,6 +721,7 @@ const MINI_PROGRAM_PERMISSION_KEYS = [
|
|
|
688
721
|
'appProtocol',
|
|
689
722
|
'workspaceCards',
|
|
690
723
|
'user_game_data',
|
|
724
|
+
'post',
|
|
691
725
|
];
|
|
692
726
|
const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
693
727
|
{
|
|
@@ -896,6 +930,19 @@ const MINI_PROGRAM_PERMISSION_CATALOG = [
|
|
|
896
930
|
'平台取数不授予小程序 `network` 权限;已交付的数据副本无法撤回。',
|
|
897
931
|
],
|
|
898
932
|
},
|
|
933
|
+
{
|
|
934
|
+
key: 'post',
|
|
935
|
+
name: '关联帖子',
|
|
936
|
+
description: '读取关联帖子与评论,或以当前用户身份互动并打开社区原生编辑器。',
|
|
937
|
+
access: 'declaration',
|
|
938
|
+
risk: 'high',
|
|
939
|
+
config: {
|
|
940
|
+
read: { type: 'boolean', required: false, default: false, description: '读取帖子、评论和订阅变化。' },
|
|
941
|
+
write: { type: 'boolean', required: false, default: false, description: '点赞、收藏、删除评论及打开社区原生编辑器。' },
|
|
942
|
+
},
|
|
943
|
+
methods: [...POST_READ_METHODS, ...POST_WRITE_METHODS],
|
|
944
|
+
conditions: ['显式声明 read / write,省略时为 false;写操作须由用户明确触发,继续执行社区审核和权限校验。'],
|
|
945
|
+
},
|
|
899
946
|
];
|
|
900
947
|
new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
901
948
|
|
|
@@ -982,6 +1029,7 @@ const MANAGED_RUNTIME_PERMISSION_KEYS = new Set(MINI_PROGRAM_PERMISSION_KEYS);
|
|
|
982
1029
|
* - `appProtocol`
|
|
983
1030
|
* - `workspaceCards`
|
|
984
1031
|
* - `user_game_data`
|
|
1032
|
+
* - `post`
|
|
985
1033
|
*
|
|
986
1034
|
* 匹配大小写敏感且按原字符串执行。该 guard 不 trim,因此 `' network '` 返回 `false`;历史权限 key
|
|
987
1035
|
* `network.request` 也返回 `false`,即使同名 capability method 仍是公开 method。消费完整 schema v1 权限快照时
|
|
@@ -1050,6 +1098,7 @@ function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
|
1050
1098
|
* 必须是已发布的精确资源 key(见 `USER_GAME_DATA_RESOURCE_KEYS`),重复或未知项会让整份
|
|
1051
1099
|
* snapshot 失败;返回值只复制校验后的 `resources` 数组,不接受 `*`、前缀或未开放 key。
|
|
1052
1100
|
* 空数组是合法的「未声明任何资源」,它不会授予任何资源级访问。
|
|
1101
|
+
* `post` 必须显式包含 `read`、`write` 两个 boolean,分别控制读取和互动;解析后丢弃其他字段。
|
|
1053
1102
|
* 其余当前权限是无配置项权限,输入 config 可以缺失、为 `null` 或 `{}`,并统一输出 `{}`;
|
|
1054
1103
|
* 非空对象、数组或其他值会使整个 snapshot 无效。Runtime snapshot 必须显式包含
|
|
1055
1104
|
* network 的有效 boolean,即使 Manifest 目录把省略 `useOfficialDomain` 的开发者默认值定义为
|
|
@@ -1062,7 +1111,7 @@ function isManagedMiniProgramRuntimePermissionKey(key) {
|
|
|
1062
1111
|
* `valid: true` 只表示 snapshot 可安全消费,不代表 entry 已启用,更不代表某个 capability 已获
|
|
1063
1112
|
* 授权。Runtime consumer 应先查 {@link MINI_PROGRAM_PROTOCOL_CAPABILITIES} 中目标 method 的
|
|
1064
1113
|
* `requirement`:`kind: 'none'` 不读取权限;`kind: 'all'` 要求列出的每个 canonical entry 都存在
|
|
1065
|
-
* 且 `status === 'enabled'
|
|
1114
|
+
* 且 `status === 'enabled'`;`post` 还要求方法对应的 `config.read` 或 `config.write` 为 true。之后仍需通过 Host capability、可信手势、用户授权、参数和业务
|
|
1066
1115
|
* policy。当前 Runtime 对 `valid: false` 按空权限表 fail closed,受保护 method 会得到
|
|
1067
1116
|
* `PERMISSION_NOT_IN_SNAPSHOT`,而不是沿用输入中的部分 enabled entry。
|
|
1068
1117
|
*
|
|
@@ -1133,6 +1182,14 @@ function parseMiniProgramRuntimePermissions(snapshot) {
|
|
|
1133
1182
|
};
|
|
1134
1183
|
continue;
|
|
1135
1184
|
}
|
|
1185
|
+
if (key === 'post') {
|
|
1186
|
+
const config = rawEntry.config;
|
|
1187
|
+
if (!isRecord$3(config) || typeof config.read !== 'boolean' || typeof config.write !== 'boolean') {
|
|
1188
|
+
return { valid: false, permissions: {} };
|
|
1189
|
+
}
|
|
1190
|
+
permissions[key] = { key, status: rawEntry.status, config: { read: config.read, write: config.write } };
|
|
1191
|
+
continue;
|
|
1192
|
+
}
|
|
1136
1193
|
if (key === 'user_game_data') {
|
|
1137
1194
|
const config = rawEntry.config;
|
|
1138
1195
|
if (!isRecord$3(config))
|
|
@@ -1278,7 +1335,7 @@ function composeLocalDevRuntimePermissions(options) {
|
|
|
1278
1335
|
*
|
|
1279
1336
|
* @param key - 权限 key。
|
|
1280
1337
|
* @param declarations - 调用方已校验的本地声明。
|
|
1281
|
-
* @returns 与权限目录 schema
|
|
1338
|
+
* @returns 与权限目录 schema 对齐的布尔配置和资源清单。
|
|
1282
1339
|
*
|
|
1283
1340
|
* @remarks
|
|
1284
1341
|
* 目前只有 `user_game_data` 的 `config.resources` 是 `resource-map`。未开放、非字符串或重复的
|
|
@@ -1291,6 +1348,10 @@ function resolveDeclarationConfig(key, declarations) {
|
|
|
1291
1348
|
return {};
|
|
1292
1349
|
const config = {};
|
|
1293
1350
|
for (const [field, spec] of Object.entries(definition.config)) {
|
|
1351
|
+
if (key === 'post' && spec.type === 'boolean') {
|
|
1352
|
+
config[field] = declarations.post?.[field] === true;
|
|
1353
|
+
continue;
|
|
1354
|
+
}
|
|
1294
1355
|
if (spec.type !== 'resource-map')
|
|
1295
1356
|
continue;
|
|
1296
1357
|
config[field] = field === 'resources' ? parseUserGameDataResourceDeclarations(declarations[key]?.resources) : {};
|
|
@@ -7747,6 +7808,14 @@ function serializeMiniProgramDevelopmentSnapshot(snapshot) {
|
|
|
7747
7808
|
declared_permissions[key] = { enabled: declaration.enabled, useOfficialDomain: declaration.useOfficialDomain === true };
|
|
7748
7809
|
continue;
|
|
7749
7810
|
}
|
|
7811
|
+
if (key === 'post') {
|
|
7812
|
+
for (const field of ['read', 'write']) {
|
|
7813
|
+
if (declaration[field] !== undefined && typeof declaration[field] !== 'boolean')
|
|
7814
|
+
throw new Error('开发权限声明无效');
|
|
7815
|
+
}
|
|
7816
|
+
declared_permissions.post = { enabled: declaration.enabled, read: declaration.read === true, write: declaration.write === true };
|
|
7817
|
+
continue;
|
|
7818
|
+
}
|
|
7750
7819
|
// `user_game_data` 的声明必须带精确资源清单;保留字段存在性,使规范化序列化可往返。
|
|
7751
7820
|
if (key === 'user_game_data') {
|
|
7752
7821
|
declared_permissions[key] = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var promises = require('node:readline/promises');
|
|
4
4
|
var node_crypto = require('node:crypto');
|
|
5
5
|
var node_http = require('node:http');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-DcyYtbXh.cjs');
|
|
7
7
|
var browser = require('./browser-RAy8e8cV.cjs');
|
|
8
8
|
require('node:module');
|
|
9
9
|
require('readline');
|
|
@@ -4,7 +4,7 @@ var fs = require('node:fs/promises');
|
|
|
4
4
|
var node_module = require('node:module');
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var node_url = require('node:url');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-DcyYtbXh.cjs');
|
|
8
8
|
|
|
9
9
|
async function loadProjectVite(projectRoot) {
|
|
10
10
|
const projectRequire = node_module.createRequire(path.join(projectRoot, 'package.json'));
|