@heybox/hb-sdk 0.9.9-alpha.1 → 0.9.9-alpha.3

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cli-chunks/{build-vZ5iT2JO.cjs → build-Dc3AGpKV.cjs} +4 -4
  3. package/dist/cli-chunks/{create-DJseFABS.cjs → create-D9ZsHehr.cjs} +1 -1
  4. package/dist/cli-chunks/{dev-CsuAVpLX.cjs → dev-9WepxPF8.cjs} +9 -9
  5. package/dist/cli-chunks/{doctor-BYzYg-oP.cjs → doctor-CB5vL_SZ.cjs} +1 -1
  6. package/dist/cli-chunks/{game-binding-guide-BfKQ4e83.cjs → game-binding-guide-B7KFiYYf.cjs} +2 -2
  7. package/dist/cli-chunks/{game-bindings-DWOIBCax.cjs → game-bindings-D_HCEbRb.cjs} +3 -3
  8. package/dist/cli-chunks/{games-DmPaqaDd.cjs → games-CXIboMim.cjs} +1 -1
  9. package/dist/cli-chunks/{index-D5rcGk_z.cjs → index-5LPhhYhg.cjs} +28 -20
  10. package/dist/cli-chunks/{index-DPEhBPfc.cjs → index-Cq1DwIuL.cjs} +1 -1
  11. package/dist/cli-chunks/{index.esm-DYWovNyE.cjs → index.esm-hXk1t26Z.cjs} +8 -8
  12. package/dist/cli-chunks/{login-o1LQxi8P.cjs → login-BOOCI2NK.cjs} +1 -1
  13. package/dist/cli-chunks/{project-vite-CGIy1XaL.cjs → project-vite-DID3simU.cjs} +1 -1
  14. package/dist/cli-chunks/{remote-BQ3O-aiB.cjs → remote-BLe4FFDF.cjs} +39 -10
  15. package/dist/cli-chunks/{runtime-permission-env-soFtqTxP.cjs → runtime-permission-env-BZqTMTBq.cjs} +2 -2
  16. package/dist/cli-chunks/{skill-BHighcnl.cjs → skill-ChOR4tTi.cjs} +2 -2
  17. package/dist/cli-chunks/{version-CAh_EBAH.cjs → version-IiostEgb.cjs} +1 -1
  18. package/dist/cli.cjs +1 -1
  19. package/dist/devtools/browser-dev-host/assets/{browser-dev-host-D9CVFRHE.js → browser-dev-host-CJlv77O-.js} +16 -16
  20. package/dist/devtools/browser-dev-host/assets/{desktop-app-launch-FZ3iQQs-.js → desktop-app-launch-B5zjL7-Y.js} +1 -1
  21. package/dist/devtools/browser-dev-host/assets/{index-CVzVitcL.js → index-Bk-EK2ib.js} +3 -3
  22. package/dist/devtools/browser-dev-host/index.html +2 -2
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.esm.js +1 -1
  25. package/dist/vite.cjs.js +1 -1
  26. package/dist/vite.esm.js +1 -1
  27. package/package.json +5 -5
  28. package/skill/skill.json +4 -4
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  本文件随 `@heybox/hb-sdk` npm 包公开分发,只记录外部小程序开发者可观察到的变化。
4
4
 
5
+ ## 0.9.9-alpha.3 - 2026-11-17
6
+
7
+ ### 问题修复
8
+
9
+ - 修复[本地调试](https://docs.xiaoheihe.cn/hb_sdk/guide/cli)入口冷编译较慢时提前握手超时的问题。
10
+
11
+ ### 文档与工具
12
+
13
+ - [关联帖子](https://docs.xiaoheihe.cn/hb_sdk/guide/linked-post)的 CLI 预览分别显示标题与作者,预览和绑定命令补充完整链接的终端引用提示。
14
+
15
+ ## 0.9.9-alpha.2 - 2026-11-16
16
+
17
+ ### 文档与工具
18
+
19
+ - [关联帖子](https://docs.xiaoheihe.cn/hb_sdk/guide/linked-post)的 CLI 预览与绑定命令支持直接输入 App 分享链接或官网帖子链接,帖子标识由平台校验。
20
+
21
+ ### 问题修复
22
+
23
+ - 修复 Android 宿主中帖子点赞、取消点赞以及评论点赞、取消点赞和删除的请求参数传递,需配套更新 Runtime 宿主。
24
+
5
25
  ## 0.9.9-alpha.1 - 2026-11-14
6
26
 
7
27
  ### 新增能力
@@ -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-soFtqTxP.cjs');
6
- var index = require('./index-D5rcGk_z.cjs');
5
+ var runtimePermissionEnv = require('./runtime-permission-env-BZqTMTBq.cjs');
6
+ var index = require('./index-5LPhhYhg.cjs');
7
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-CGIy1XaL.cjs');
12
- require('./version-CAh_EBAH.cjs');
11
+ var projectVite = require('./project-vite-DID3simU.cjs');
12
+ require('./version-IiostEgb.cjs');
13
13
  require('./bindings-B9HSKhmy.cjs');
14
14
  require('node:module');
15
15
  require('node:url');
@@ -5,7 +5,7 @@ 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-D5rcGk_z.cjs');
8
+ var index = require('./index-5LPhhYhg.cjs');
9
9
  var index_esm = require('./index.esm-CenYK5Bl.cjs');
10
10
  require('node:module');
11
11
  require('readline');
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var gameBindingGuide = require('./game-binding-guide-BfKQ4e83.cjs');
3
+ var gameBindingGuide = require('./game-binding-guide-B7KFiYYf.cjs');
4
4
  var fs = require('node:fs/promises');
5
5
  var path = require('node:path');
6
- var remote = require('./remote-BQ3O-aiB.cjs');
7
- var index = require('./index-D5rcGk_z.cjs');
6
+ var remote = require('./remote-BLe4FFDF.cjs');
7
+ var index = require('./index-5LPhhYhg.cjs');
8
8
  var node_crypto = require('node:crypto');
9
9
  var fs$1 = require('node:fs');
10
10
  var index_esm = require('./index.esm-CenYK5Bl.cjs');
11
- var version = require('./version-CAh_EBAH.cjs');
12
- var runtimePermissionEnv = require('./runtime-permission-env-soFtqTxP.cjs');
11
+ var version = require('./version-IiostEgb.cjs');
12
+ var runtimePermissionEnv = require('./runtime-permission-env-BZqTMTBq.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-CGIy1XaL.cjs');
34
+ var projectVite = require('./project-vite-DID3simU.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-CsuAVpLX.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-CsuAVpLX.cjs', document.baseURI).href)))('parse5');
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-9WepxPF8.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-9WepxPF8.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-DYWovNyE.cjs'); });
12912
+ const mod = await Promise.resolve().then(function () { return require('./index.esm-hXk1t26Z.cjs'); });
12913
12913
  return mod.createNodeWebSocketRuntimeDriver();
12914
12914
  });
12915
12915
  return registry;
@@ -3,7 +3,7 @@
3
3
  var fs = require('node:fs/promises');
4
4
  var os = require('node:os');
5
5
  var path = require('node:path');
6
- var index = require('./index-D5rcGk_z.cjs');
6
+ var index = require('./index-5LPhhYhg.cjs');
7
7
  require('node:module');
8
8
  require('readline');
9
9
  require('os');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D5rcGk_z.cjs');
3
+ var index = require('./index-5LPhhYhg.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');
@@ -8,7 +8,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-DmPaqaDd.cjs');
11
+ var games = require('./games-CXIboMim.cjs');
12
12
 
13
13
  class MiniProgramProjectBindingError extends Error {
14
14
  code;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var gameBindingGuide = require('./game-binding-guide-BfKQ4e83.cjs');
4
- var index = require('./index-D5rcGk_z.cjs');
3
+ var gameBindingGuide = require('./game-binding-guide-B7KFiYYf.cjs');
4
+ var index = require('./index-5LPhhYhg.cjs');
5
5
  require('node:readline/promises');
6
6
  require('node:crypto');
7
7
  require('node:fs/promises');
@@ -9,7 +9,7 @@ require('./index.esm-CenYK5Bl.cjs');
9
9
  require('./bindings-B9HSKhmy.cjs');
10
10
  require('node:fs');
11
11
  require('node:path');
12
- require('./games-DmPaqaDd.cjs');
12
+ require('./games-CXIboMim.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-D5rcGk_z.cjs');
6
+ var index = require('./index-5LPhhYhg.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-D5rcGk_z.cjs', document.baseURI).href)));
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-5LPhhYhg.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-D5rcGk_z.cjs', document.baseURI).href)));
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-5LPhhYhg.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-D5rcGk_z.cjs', document.baseURI).href)));
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-5LPhhYhg.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-D5rcGk_z.cjs', document.baseURI).href)));
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-5LPhhYhg.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-D5rcGk_z.cjs', document.baseURI).href)));
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-5LPhhYhg.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-DPEhBPfc.cjs'); }).then(function (n) { return n.index; });
17256
+ const { default: COS } = await Promise.resolve().then(function () { return require('./index-Cq1DwIuL.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.1';
21938
+ const BUILT_CLI_VERSION = '0.9.9-alpha.3';
21939
21939
  const PACKAGE_JSON_CANDIDATES$1 = [
21940
21940
  path.resolve(__dirname, '..', '..', 'package.json'),
21941
21941
  path.resolve(__dirname, '..', 'package.json'),
@@ -23181,10 +23181,18 @@ function installRemoteCommands(program, handlers, resolveLogger) {
23181
23181
  addRemotePublicOptions(remote.command('info').description('查看当前绑定的远程工坊小程序详情')).action(createRemoteAction(handlers, resolveLogger, 'info'));
23182
23182
  const post = addRemotePublicOptions(remote.command('post').description('管理小程序关联帖子;每个小程序最多关联一篇自己的公开帖子'));
23183
23183
  addRemotePublicOptions(post.command('get').description('查看当前关联帖子')).action(createRemoteAction(handlers, resolveLogger, 'post:get'));
23184
- addRemotePublicOptions(post.command('preview').description('校验并预览待关联的帖子').argument('<post-id>', '帖子 ID')).action(createRemoteAction(handlers, resolveLogger, 'post:preview', (_command, postId) => ({
23184
+ addRemotePublicOptions(post
23185
+ .command('preview')
23186
+ .addHelpText('after', '\n使用帖子链接时,请用英文双引号包裹完整链接,避免 & 被 shell 解析。\n示例\n npm exec hb-sdk -- remote post preview "https://api.xiaoheihe.cn/v3/bbs/app/api/web/share?link_id=43ef72d469fb&h_src=app"\n请直接复制 URL,不要包含 Markdown 的 [文字](链接) 格式。')
23187
+ .description('校验并预览待关联的帖子')
23188
+ .argument('<post-id-or-url>', '帖子 ID 或小黑盒帖子链接,链接必须用英文双引号包裹')).action(createRemoteAction(handlers, resolveLogger, 'post:preview', (_command, postId) => ({
23185
23189
  postId: readStringArgument(postId, 'post-id'),
23186
23190
  })));
23187
- addRemotePublicOptions(post.command('bind').description('关联或更换帖子').argument('<post-id>', '帖子 ID')).action(createRemoteAction(handlers, resolveLogger, 'post:bind', (_command, postId) => ({
23191
+ addRemotePublicOptions(post
23192
+ .command('bind')
23193
+ .addHelpText('after', '\n使用帖子链接时,请用英文双引号包裹完整链接,避免 & 被 shell 解析。\n示例\n npm exec hb-sdk -- remote post bind "https://api.xiaoheihe.cn/v3/bbs/app/api/web/share?link_id=43ef72d469fb&h_src=app"\n请直接复制 URL,不要包含 Markdown 的 [文字](链接) 格式。')
23194
+ .description('关联或更换帖子')
23195
+ .argument('<post-id-or-url>', '帖子 ID 或小黑盒帖子链接,链接必须用英文双引号包裹')).action(createRemoteAction(handlers, resolveLogger, 'post:bind', (_command, postId) => ({
23188
23196
  postId: readStringArgument(postId, 'post-id'),
23189
23197
  })));
23190
23198
  addRemotePublicOptions(post.command('unbind').description('解除当前帖子关联')).action(createRemoteAction(handlers, resolveLogger, 'post:unbind'));
@@ -23373,39 +23381,39 @@ function createCommandLoggerResolver(options) {
23373
23381
  };
23374
23382
  }
23375
23383
  const defaultClearLoginStatus = async (...args) => {
23376
- const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-o1LQxi8P.cjs'); });
23384
+ const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-BOOCI2NK.cjs'); });
23377
23385
  return clearLoginStatus(...args);
23378
23386
  };
23379
23387
  const defaultLoginToHeybox = async (...args) => {
23380
- const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-o1LQxi8P.cjs'); });
23388
+ const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-BOOCI2NK.cjs'); });
23381
23389
  return loginToHeybox(...args);
23382
23390
  };
23383
23391
  const defaultPrintLoginStatus = async (...args) => {
23384
- const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-o1LQxi8P.cjs'); });
23392
+ const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-BOOCI2NK.cjs'); });
23385
23393
  return printLoginStatus(...args);
23386
23394
  };
23387
23395
  const defaultRunBuildCommand = async (...args) => {
23388
- const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-vZ5iT2JO.cjs'); });
23396
+ const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-Dc3AGpKV.cjs'); });
23389
23397
  return runBuildCommand(...args);
23390
23398
  };
23391
23399
  const defaultRunCreateCommand = async (...args) => {
23392
- const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-DJseFABS.cjs'); });
23400
+ const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-D9ZsHehr.cjs'); });
23393
23401
  return runCreateCommand(...args);
23394
23402
  };
23395
23403
  const defaultRunDevCommand = async (...args) => {
23396
- const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-CsuAVpLX.cjs'); }).then(function (n) { return n.dev; });
23404
+ const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-9WepxPF8.cjs'); }).then(function (n) { return n.dev; });
23397
23405
  return runDevCommand(...args);
23398
23406
  };
23399
23407
  const defaultRunDoctorCommand = async (...args) => {
23400
- const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-BYzYg-oP.cjs'); });
23408
+ const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-CB5vL_SZ.cjs'); });
23401
23409
  return runDoctorCommand(...args);
23402
23410
  };
23403
23411
  const defaultRunSkillInstallCommand = async (...args) => {
23404
- const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-BHighcnl.cjs'); });
23412
+ const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-ChOR4tTi.cjs'); });
23405
23413
  return runSkillInstallCommand(...args);
23406
23414
  };
23407
23415
  const defaultRunRemoteCommand = async (...args) => {
23408
- const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-BQ3O-aiB.cjs'); }).then(function (n) { return n.remote; });
23416
+ const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-BLe4FFDF.cjs'); }).then(function (n) { return n.remote; });
23409
23417
  return runRemoteCommand(...args);
23410
23418
  };
23411
23419
  function resolveStandaloneLogger(options, verbose) {
@@ -23531,11 +23539,11 @@ function parseNonNegativeInteger(value) {
23531
23539
  return parsed;
23532
23540
  }
23533
23541
  const defaultRunGameSearchCommand = async (...args) => {
23534
- const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-DmPaqaDd.cjs'); });
23542
+ const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-CXIboMim.cjs'); });
23535
23543
  return runGameSearchCommand(...args);
23536
23544
  };
23537
23545
  const defaultRunConfigureGameBindingsCommand = async (...args) => {
23538
- const { runConfigureGameBindingsCommand } = await Promise.resolve().then(function () { return require('./game-bindings-DWOIBCax.cjs'); });
23546
+ const { runConfigureGameBindingsCommand } = await Promise.resolve().then(function () { return require('./game-bindings-D_HCEbRb.cjs'); });
23539
23547
  return runConfigureGameBindingsCommand(...args);
23540
23548
  };
23541
23549
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index$2 = require('./index-D5rcGk_z.cjs');
3
+ var index$2 = require('./index-5LPhhYhg.cjs');
4
4
  var require$$0$3 = require('fs');
5
5
  var require$$0$2 = require('crypto');
6
6
  var require$$1$2 = require('path');
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var dev = require('./dev-CsuAVpLX.cjs');
4
- require('./game-binding-guide-BfKQ4e83.cjs');
5
- require('./index-D5rcGk_z.cjs');
3
+ var dev = require('./dev-9WepxPF8.cjs');
4
+ require('./game-binding-guide-B7KFiYYf.cjs');
5
+ require('./index-5LPhhYhg.cjs');
6
6
  require('node:module');
7
7
  require('readline');
8
8
  require('os');
@@ -26,10 +26,10 @@ require('node:readline/promises');
26
26
  require('node:timers/promises');
27
27
  require('./index.esm-CenYK5Bl.cjs');
28
28
  require('./bindings-B9HSKhmy.cjs');
29
- require('./games-DmPaqaDd.cjs');
30
- require('./remote-BQ3O-aiB.cjs');
31
- require('./runtime-permission-env-soFtqTxP.cjs');
32
- require('./version-CAh_EBAH.cjs');
29
+ require('./games-CXIboMim.cjs');
30
+ require('./remote-BLe4FFDF.cjs');
31
+ require('./runtime-permission-env-BZqTMTBq.cjs');
32
+ require('./version-IiostEgb.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-CGIy1XaL.cjs');
54
+ require('./project-vite-DID3simU.cjs');
55
55
 
56
56
  /**
57
57
  * @packageDocumentation
@@ -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-D5rcGk_z.cjs');
6
+ var index = require('./index-5LPhhYhg.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-D5rcGk_z.cjs');
7
+ var index = require('./index-5LPhhYhg.cjs');
8
8
 
9
9
  async function loadProjectVite(projectRoot) {
10
10
  const projectRequire = node_module.createRequire(path.join(projectRoot, 'package.json'));
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  var index_esm = require('./index.esm-CenYK5Bl.cjs');
4
- var runtimePermissionEnv = require('./runtime-permission-env-soFtqTxP.cjs');
4
+ var runtimePermissionEnv = require('./runtime-permission-env-BZqTMTBq.cjs');
5
5
  var node_crypto = require('node:crypto');
6
6
  var fs = require('node:fs/promises');
7
7
  var path = require('node:path');
8
8
  var fs$1 = require('node:fs');
9
9
  var sharp = require('sharp');
10
- var gameBindingGuide = require('./game-binding-guide-BfKQ4e83.cjs');
10
+ var gameBindingGuide = require('./game-binding-guide-B7KFiYYf.cjs');
11
11
  var promises = require('node:readline/promises');
12
- var index = require('./index-D5rcGk_z.cjs');
12
+ var index = require('./index-5LPhhYhg.cjs');
13
13
  var childProcess = require('node:child_process');
14
14
  require('node:zlib');
15
15
 
@@ -509,7 +509,7 @@ function createDefaultCosClient(uploadToken, COS) {
509
509
  };
510
510
  }
511
511
  async function loadCosConstructor() {
512
- const cosModule = await Promise.resolve().then(function () { return require('./index-DPEhBPfc.cjs'); }).then(function (n) { return n.index; });
512
+ const cosModule = await Promise.resolve().then(function () { return require('./index-Cq1DwIuL.cjs'); }).then(function (n) { return n.index; });
513
513
  return cosModule.default;
514
514
  }
515
515
  function formatSize(bytes) {
@@ -1438,6 +1438,37 @@ function suggestNextPatchVersion(version) {
1438
1438
  return `${matched[1]}.${matched[2]}.${Number(matched[3]) + 1}`;
1439
1439
  }
1440
1440
 
1441
+ const MAX_POST_ID = 9223372036854775807n;
1442
+ function isPostId(value) {
1443
+ return /^[1-9]\d{0,18}$/.test(value) && BigInt(value) <= MAX_POST_ID;
1444
+ }
1445
+ /** 只提取官方链接里的帖子标识,编码 ID 由后端解码校验。 */
1446
+ function parsePostReference(value) {
1447
+ const input = value.trim();
1448
+ if (isPostId(input))
1449
+ return input;
1450
+ let url;
1451
+ try {
1452
+ url = new URL(input);
1453
+ }
1454
+ catch {
1455
+ throw new Error('请提供有效的帖子 ID 或小黑盒帖子链接。链接请用英文双引号包裹,例如 npm exec hb-sdk -- remote post preview "https://api.xiaoheihe.cn/v3/bbs/app/api/web/share?link_id=43ef72d469fb&h_src=app",并去掉 Markdown 的 [文字](链接) 格式');
1456
+ }
1457
+ if (!['https:', 'http:'].includes(url.protocol) ||
1458
+ url.username ||
1459
+ url.password ||
1460
+ url.port ||
1461
+ !['api.xiaoheihe.cn', 'www.xiaoheihe.cn', 'web.xiaoheihe.cn', 'heybox.debugmode.cn', 'web.debugmode.cn'].includes(url.hostname)) {
1462
+ throw new Error('请提供小黑盒官方帖子链接');
1463
+ }
1464
+ const reference = url.pathname === '/v3/bbs/app/api/web/share' ? url.searchParams.get('link_id') : /^\/app\/bbs\/link\/([a-zA-Z0-9]+)\/?$/.exec(url.pathname)?.[1];
1465
+ if (!reference)
1466
+ throw new Error('帖子链接中没有有效的帖子 ID');
1467
+ if (isPostId(reference) || /^[0-9a-f]{5,20}$/.test(reference))
1468
+ return reference;
1469
+ throw new Error('帖子链接中的 ID 格式无效,请重新复制帖子链接');
1470
+ }
1471
+
1441
1472
  async function runRemoteCommand(options, runtime = {}) {
1442
1473
  if (options.command === 'deploy') {
1443
1474
  return runRemoteDeployCommand(options, runtime);
@@ -1750,14 +1781,12 @@ async function remotePostBinding(options, context, runtime) {
1750
1781
  binding: { postId: result.post_id },
1751
1782
  });
1752
1783
  }
1753
- const postId = options.command === 'post:unbind' ? '' : requireNonEmpty(options.postId, '必须传入帖子 ID');
1754
- if (postId && (!/^[1-9]\d{0,18}$/.test(postId) || BigInt(postId) > 9223372036854775807n)) {
1755
- throw new Error('帖子 ID 必须为有效的正整数');
1756
- }
1784
+ const postId = options.command === 'post:unbind' ? '' : parsePostReference(requireNonEmpty(options.postId, '必须传入帖子 ID 或链接'));
1757
1785
  if (options.command === 'post:preview') {
1758
1786
  const result = await context.api.previewPostBinding({ miniProgramId, postId });
1759
- if (!options.json)
1760
- context.logger.info(`${result.title || '无标题帖子'}(${result.post_id}),作者:${result.author_name}`);
1787
+ if (!options.json) {
1788
+ context.logger.info(`标题:${result.title || '无标题帖子'}\n作者:${result.author_name}`);
1789
+ }
1761
1790
  return finishRemoteCommand(options, runtime, { changed: false, miniProgramId, post: toCamelCaseDeep(result) });
1762
1791
  }
1763
1792
  await assertBoundMiniProgramEntityMatchesCurrent(context, miniProgramId);
@@ -2,11 +2,11 @@
2
2
 
3
3
  var fs = require('node:fs');
4
4
  var path = require('node:path');
5
- var version = require('./version-CAh_EBAH.cjs');
5
+ var version = require('./version-IiostEgb.cjs');
6
6
  var bindings = require('./bindings-B9HSKhmy.cjs');
7
7
  var fs$1 = require('node:fs/promises');
8
8
  var index_esm = require('./index.esm-CenYK5Bl.cjs');
9
- var index = require('./index-D5rcGk_z.cjs');
9
+ var index = require('./index-5LPhhYhg.cjs');
10
10
  var node_crypto = require('node:crypto');
11
11
  require('node:zlib');
12
12
  require('node:module');
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var version = require('./version-CAh_EBAH.cjs');
3
+ var version = require('./version-IiostEgb.cjs');
4
4
  var fs = require('node:fs/promises');
5
5
  var path = require('node:path');
6
6
  var childProcess = require('node:child_process');
7
- var index = require('./index-D5rcGk_z.cjs');
7
+ var index = require('./index-5LPhhYhg.cjs');
8
8
  require('node:module');
9
9
  require('readline');
10
10
  require('os');
@@ -3,6 +3,6 @@
3
3
  /** 构建时替换为当前发布包的实际版本。 */
4
4
  const HB_SDK_VERSION = typeof undefined === 'string'
5
5
  ? undefined
6
- : '0.9.9-alpha.1';
6
+ : '0.9.9-alpha.3';
7
7
 
8
8
  exports.HB_SDK_VERSION = HB_SDK_VERSION;
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./cli-chunks/index-D5rcGk_z.cjs');
3
+ var index = require('./cli-chunks/index-5LPhhYhg.cjs');
4
4
  require('node:module');
5
5
  require('readline');
6
6
  require('os');