@heybox/hb-sdk 0.5.5 → 0.5.8

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/README.md CHANGED
@@ -341,10 +341,9 @@ try {
341
341
  | `hb-sdk remote entity current` | 查看服务端 current entity,以及该主体的小程序工坊权限状态。 |
342
342
  | `hb-sdk remote entity switch <entity-id>` | 切换开发者平台服务端 current entity;不会修改项目绑定的小程序 ID。 |
343
343
  | `hb-sdk remote list [--status <status>] [--keyword <text>]` | 列出当前 CLI 用户可管理的远端工坊小程序,用于发现并绑定当前项目。 |
344
- | `hb-sdk remote create --name <name> [--preview-image-url <url>] [--yes] [--force-bind]` | 在服务端 current entity 下创建远端工坊小程序并写入当前项目的 `package.json.heybox.miniProgramId`。 |
344
+ | `hb-sdk remote create [--yes] [--force-bind]` | 在服务端 current entity 下创建远端工坊小程序并写入当前项目的 `package.json.heybox.miniProgramId`。 |
345
345
  | `hb-sdk remote bind <mini-program-id> [--force]` | 校验当前 CLI 用户可管理目标小程序后,再把它绑定到当前项目。 |
346
346
  | `hb-sdk remote info` | 查看当前项目绑定的小程序详情。 |
347
- | `hb-sdk remote update [--name <name>] [--preview-image-url <url>]` | 更新绑定小程序的名称或远程预览图 URL。 |
348
347
  | `hb-sdk remote allowlist list/add/remove/set ...` | 管理绑定小程序的预览白名单。 |
349
348
  | `hb-sdk remote deploy --release-note <text> [--skip-build] [--auto-publish]` | 构建、上传并提交当前小程序版本审核;`--skip-build` 跳过 build 直接上传 `dist/`。 |
350
349
  | `hb-sdk remote versions` | 列出绑定小程序的远端版本。 |
@@ -353,6 +352,8 @@ try {
353
352
  | `hb-sdk remote withdraw <version> [--yes] [--reason <text>]` | 撤回审核中或已通过但未发布的版本;非 TTY 环境必须传 `--yes`。 |
354
353
  | `hb-sdk remote take-down [--yes]` | 下架当前线上小程序;非 TTY 环境必须传 `--yes`。 |
355
354
  | `hb-sdk remote reopen [--yes]` | 重新上架已下架的小程序;非 TTY 环境必须传 `--yes`。 |
355
+ | `hb-sdk remote square hide [--yes]` | 隐藏当前绑定小程序在普通用户侧的小程序工坊广场展示;白名单用户仍可见,直接链接不受影响;非 TTY 环境必须传 `--yes`。 |
356
+ | `hb-sdk remote square show` | 恢复当前绑定小程序在普通用户侧的小程序工坊广场展示。 |
356
357
 
357
358
  远端平台操作统一放在 `hb-sdk remote` 命令组下;顶层 `hb-sdk deploy` 已硬切删除,不再作为兼容别名保留。`hb-sdk login` 仍是顶层命令,因为它管理 CLI 登录态,不绑定到某个具体小程序。开发者主体的事实源是服务端 current entity;CLI 登录缓存中的 `selectedEntity` 只是上次选择时的提示快照,用于 `login status` 展示和漂移排障,不能作为权限或归属判断依据。
358
359
 
@@ -375,7 +376,8 @@ try {
375
376
  2. 已运行过 `hb-sdk login` 登录 Heybox;多主体用户应确认 `hb-sdk remote entity current` 指向要发布的主体。
376
377
  3. 当前项目绑定的小程序必须属于服务端 current entity;如不一致,先运行 `hb-sdk remote entity switch <entity-id>` 切换主体。
377
378
  4. 如果需要以公司的名义发布小程序,需先找 @秦浩东 申请小程序开发权限。
378
- 5. 每次部署都要准备发布日志:`hb-sdk remote deploy --release-note "..."`。发布日志 trim 后不能为空,最多 500 个字符,允许换行;CI / 非 TTY 环境缺失时会直接失败,TTY 环境会提示输入。
379
+ 5. 每次部署都要在 `package.json` 里配置 `heybox.miniProgramProfile.name`、`iconUrl` 和至少一张 `coverImageUrls`,这些资料会随版本提交审核。
380
+ 6. 每次部署都要准备发布日志:`hb-sdk remote deploy --release-note "..."`。发布日志 trim 后不能为空,最多 500 个字符,允许换行;CI / 非 TTY 环境缺失时会直接失败,TTY 环境会提示输入。
379
381
  6. 项目根有 `scripts.build`,会被 CLI 通过 lockfile 自动选用的 `pnpm`、`yarn` 或 `npm` 触发;无 lockfile 时回退 `npm`。
380
382
  7. 构建产物落在 `dist/`,包含 `index.html` 和 `manifest.json`。
381
383
 
@@ -397,7 +399,20 @@ try {
397
399
 
398
400
  `--skip-build` 用于 CI 双阶段:上一步已经 build 完缓存好了 `dist/`,本步只做预检、上传和提交审核。`dist/manifest.json` 或 `dist/index.html` 缺失会立即报错。
399
401
 
400
- `manifest.json` 不会上传到 CDN,只作为 submit audit 请求的 `manifest` 字段提交。这与 Vite 插件文档中的契约一致。
402
+ `manifest.json` 不会上传到 CDN,只作为 submit audit 请求的 `manifest` 字段提交。这与 Vite 插件文档中的契约一致。名称、icon 和介绍图从 `package.json.heybox.miniProgramProfile` 读取,并随 precheck 和 submit audit 一起提交:
403
+
404
+ ```json
405
+ {
406
+ "heybox": {
407
+ "miniProgramId": "mp_xxxxxxxx",
408
+ "miniProgramProfile": {
409
+ "name": "我的小程序",
410
+ "iconUrl": "https://img.example.test/icon.png",
411
+ "coverImageUrls": ["https://img.example.test/cover.png"]
412
+ }
413
+ }
414
+ }
415
+ ```
401
416
 
402
417
  内部测试或预发环境可通过 origin 级别的自定义地址切换后台环境:
403
418
 
@@ -413,7 +428,7 @@ hb-sdk remote deploy --verbose --api-base-url https://api.test.xiaoheihe.cn --lo
413
428
  HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1 hb-sdk remote deploy --api-base-url http://127.0.0.1:8080 --release-note "本地后台联调"
414
429
  ```
415
430
 
416
- `--api-base-url` 优先于 `HB_SDK_API_BASE_URL`,影响 `hb-sdk remote` 里的远端平台后台 API,包括预检、CDN 上传凭证/回调、提交审核、版本、发布、撤回、下架、重新上架、详情、基础信息和白名单等调用;`--login-base-url` 优先于 `HB_SDK_LOGIN_BASE_URL`,用于 `hb-sdk login` 的登录入口,以及 remote 命令前校验当前 CLI 登录态是否属于同一个登录环境。仓库内开发可在 `packages/hb-sdk/src/cli/config.ts` 里按 `@heybox/hb-types` 的 `RylaiServiceTagConfig` 配置 `default_tag` 或 path-prefix 级 `special_tag`,给 Heybox 后台请求附加 `x-rylai-service-tag` header,并复用命中的 tag 追加 `special_tag` 请求参数,用于开发环境路由或灰度验证。自定义地址只接受 origin,不允许包含 path、query 或 hash;API origin 默认还必须是 Heybox 受信 HTTPS 域名,只有本地联调等场景可显式使用 `--allow-unsafe-api-base-url` 或 `HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1` 放开。日志只输出 origin,不输出带身份和签名参数的完整请求 URL。`hb-sdk doctor`、npm latest 检查、mock host 的 `network.request()` 不受这些配置影响。
431
+ `--api-base-url` 优先于 `HB_SDK_API_BASE_URL`,影响 `hb-sdk remote` 里的远端平台后台 API,包括预检、CDN 上传凭证/回调、提交审核、版本、发布、撤回、下架、重新上架、详情和白名单等调用;`--login-base-url` 优先于 `HB_SDK_LOGIN_BASE_URL`,用于 `hb-sdk login` 的登录入口,以及 remote 命令前校验当前 CLI 登录态是否属于同一个登录环境。仓库内开发可在 `packages/hb-sdk/src/cli/config.ts` 里按 `@heybox/hb-types` 的 `RylaiServiceTagConfig` 配置 `default_tag` 或 path-prefix 级 `special_tag`,给 Heybox 后台请求附加 `x-rylai-service-tag` header,并复用命中的 tag 追加 `special_tag` 请求参数,用于开发环境路由或灰度验证。自定义地址只接受 origin,不允许包含 path、query 或 hash;API origin 默认还必须是 Heybox 受信 HTTPS 域名,只有本地联调等场景可显式使用 `--allow-unsafe-api-base-url` 或 `HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1` 放开。日志只输出 origin,不输出带身份和签名参数的完整请求 URL。`hb-sdk doctor`、npm latest 检查、mock host 的 `network.request()` 不受这些配置影响。
417
432
 
418
433
  ## hb-sdk remote 命令参考
419
434
 
@@ -426,10 +441,9 @@ HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1 hb-sdk remote deploy --api-base-url http://12
426
441
  | `hb-sdk remote entity current` | 查看服务端 current entity 和该主体的小程序工坊权限状态。 |
427
442
  | `hb-sdk remote entity switch <entity-id>` | 切换服务端 current entity;只允许切到 `entity list` 返回的主体。 |
428
443
  | `hb-sdk remote list [--status <status>] [--keyword <text>]` | 列出 current entity 下当前 CLI 用户可管理的小程序,并标出当前绑定项。 |
429
- | `hb-sdk remote create --name <name> [--preview-image-url <url>] [--yes] [--force-bind]` | 在 current entity 下创建远端小程序并绑定当前项目;多主体非 TTY 环境必须传 `--yes` 确认使用当前主体;已有绑定时必须显式传 `--force-bind` 才能覆盖。 |
444
+ | `hb-sdk remote create [--yes] [--force-bind]` | 在 current entity 下创建远端小程序并绑定当前项目;多主体非 TTY 环境必须传 `--yes` 确认使用当前主体;已有绑定时必须显式传 `--force-bind` 才能覆盖。 |
430
445
  | `hb-sdk remote bind <mini-program-id> [--force]` | 先校验 current entity 可管理目标小程序,再写入当前项目绑定;`--force` 只允许覆盖本地绑定,不跳过远端校验或主体一致性校验。 |
431
446
  | `hb-sdk remote info` | 查看当前绑定小程序的远端详情。 |
432
- | `hb-sdk remote update [--name <name>] [--preview-image-url <url>]` | 更新名称或远程预览图 URL,至少传一个变更字段。 |
433
447
  | `hb-sdk remote allowlist list` | 查看预览白名单。 |
434
448
  | `hb-sdk remote allowlist add <heybox-id...>` | 添加十进制 Heybox ID 到预览白名单。 |
435
449
  | `hb-sdk remote allowlist remove <heybox-id...>` | 从预览白名单移除非 owner 条目。 |
@@ -441,6 +455,8 @@ HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1 hb-sdk remote deploy --api-base-url http://12
441
455
  | `hb-sdk remote withdraw <version> [--yes] [--reason <text>]` | 撤回审核中或已通过但未发布的版本;交互式终端会确认,非 TTY 必须传 `--yes`。 |
442
456
  | `hb-sdk remote take-down [--yes]` | 下架当前线上小程序;交互式终端会确认,非 TTY 必须传 `--yes`。 |
443
457
  | `hb-sdk remote reopen [--yes]` | 重新上架已下架的小程序;交互式终端会确认,非 TTY 必须传 `--yes`。 |
458
+ | `hb-sdk remote square hide [--yes]` | 隐藏当前绑定小程序在普通用户侧的小程序工坊广场展示;白名单用户仍可见,直接链接不受影响;交互式终端会确认,非 TTY 必须传 `--yes`。 |
459
+ | `hb-sdk remote square show` | 恢复当前绑定小程序在普通用户侧的小程序工坊广场展示。 |
444
460
 
445
461
  CLI 登录态只供 CLI 命令访问黑盒接口时复用,不会注入 iframe SDK,也不会改变 `auth.login()`、`user.getInfo()`、`network.request()` 或 mock 宿主中的用户状态。`hb-sdk login` 成功后会尝试读取开发者主体列表:单主体自动确认或切换为 current entity,多主体交互式环境要求选择主体,多主体非 TTY 环境只提示后续运行 `hb-sdk remote entity switch <entity-id>`;显式传 `--no-select-entity` 时只写登录态,不修改服务端 current entity。`hb-sdk login status` 默认展示脱敏状态、`heyboxId`、`loginBaseUrl`、登录时间和本地 `selectedEntity` 提示快照;`--verbose` 额外展示 cache 路径。不输出 `pkey`、cookie 或完整请求头。`selectedEntity` 不是权限事实源,每次 remote 命令仍以服务端 current entity 为准。
446
462
 
@@ -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-D-F9nQns.cjs');
8
+ var index = require('./index-Dyn_R89O.cjs');
9
9
  require('node:module');
10
10
  require('os');
11
11
  require('readline');
@@ -9,7 +9,7 @@ var node_url = require('node:url');
9
9
  var net = require('node:net');
10
10
  var node_http = require('node:http');
11
11
  var browser = require('./browser-RAy8e8cV.cjs');
12
- var index = require('./index-D-F9nQns.cjs');
12
+ var index = require('./index-Dyn_R89O.cjs');
13
13
  require('node:process');
14
14
  require('node:buffer');
15
15
  require('node:util');
@@ -4,7 +4,7 @@ var fs$1 = require('node:fs');
4
4
  var fs = require('node:fs/promises');
5
5
  var os = require('node:os');
6
6
  var path = require('node:path');
7
- var index = require('./index-D-F9nQns.cjs');
7
+ var index = require('./index-Dyn_R89O.cjs');
8
8
  require('node:module');
9
9
  require('path');
10
10
  require('os');
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index$2 = require('./index-D-F9nQns.cjs');
3
+ var index$2 = require('./index-Dyn_R89O.cjs');
4
4
  var require$$0$2 = require('fs');
5
5
  var require$$2$1 = require('crypto');
6
6
  var require$$1$2 = require('path');
7
7
  var require$$0$3 = require('assert');
8
8
  var require$$4$2 = require('events');
9
9
  var require$$1$1 = require('util');
10
- var remote = require('./remote-TcGy7SWm.cjs');
10
+ var remote = require('./remote-C5pPFOvG.cjs');
11
11
  var require$$0$5 = require('net');
12
12
  var require$$0$4 = require('url');
13
13
  var require$$2$2 = require('http');
@@ -234,19 +234,19 @@ function requireArgument () {
234
234
 
235
235
  var command = {};
236
236
 
237
- 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-D-F9nQns.cjs', document.baseURI).href)));
237
+ 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-Dyn_R89O.cjs', document.baseURI).href)));
238
238
  function __require$4() { return require$5("node:events"); }
239
239
 
240
- 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-D-F9nQns.cjs', document.baseURI).href)));
240
+ 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-Dyn_R89O.cjs', document.baseURI).href)));
241
241
  function __require$3() { return require$4("node:child_process"); }
242
242
 
243
- 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-D-F9nQns.cjs', document.baseURI).href)));
243
+ 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-Dyn_R89O.cjs', document.baseURI).href)));
244
244
  function __require$2() { return require$3("node:path"); }
245
245
 
246
- 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-D-F9nQns.cjs', document.baseURI).href)));
246
+ 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-Dyn_R89O.cjs', document.baseURI).href)));
247
247
  function __require$1() { return require$2("node:fs"); }
248
248
 
249
- 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-D-F9nQns.cjs', document.baseURI).href)));
249
+ 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-Dyn_R89O.cjs', document.baseURI).href)));
250
250
  function __require() { return require$1("node:process"); }
251
251
 
252
252
  var help = {};
@@ -13094,7 +13094,7 @@ function readErrorMessage(error, options = {}) {
13094
13094
  }
13095
13095
 
13096
13096
  const CLI_VERSION_PLACEHOLDER = ['__HB', 'SDK', 'CLI', 'VERSION__'].join('_');
13097
- const BUILT_CLI_VERSION = '0.5.5';
13097
+ const BUILT_CLI_VERSION = '0.5.8';
13098
13098
  const PACKAGE_JSON_CANDIDATES = [
13099
13099
  path.resolve(__dirname, '..', '..', 'package.json'),
13100
13100
  path.resolve(__dirname, '..', 'package.json'),
@@ -13239,10 +13239,7 @@ function installRemoteCommands(program, handlers, resolveLogger) {
13239
13239
  addRemotePublicOptions(remote
13240
13240
  .command('create')
13241
13241
  .description('创建远程工坊小程序并绑定当前项目')
13242
- .requiredOption('--name <name>', '小程序名称')
13243
- .option('--preview-image-url <url>', '远程预览图 HTTPS URL')
13244
13242
  .option('--force-bind', '允许覆盖当前 package.json 中已有绑定')).option('--yes', '多开发者主体时确认使用服务端 current 主体创建').action(createRemoteAction(handlers, resolveLogger, 'create', (command) => ({
13245
- ...pickOptions(command, ['name', 'previewImageUrl']),
13246
13243
  forceBind: Boolean(readCommandOptionsWithAncestors(command).forceBind),
13247
13244
  ...readYesOption(command),
13248
13245
  })));
@@ -13251,11 +13248,6 @@ function installRemoteCommands(program, handlers, resolveLogger) {
13251
13248
  miniProgramId: readStringArgument(miniProgramId, 'mini-program-id'),
13252
13249
  })));
13253
13250
  addRemotePublicOptions(remote.command('info').description('查看当前绑定的远程工坊小程序详情')).action(createRemoteAction(handlers, resolveLogger, 'info'));
13254
- addRemotePublicOptions(remote
13255
- .command('update')
13256
- .description('更新当前绑定的远程工坊小程序基础信息')
13257
- .option('--name <name>', '小程序名称')
13258
- .option('--preview-image-url <url>', '远程预览图 HTTPS URL')).action(createRemoteAction(handlers, resolveLogger, 'update', (command) => pickOptions(command, ['name', 'previewImageUrl'])));
13259
13251
  const allowlist = addRemotePublicOptions(remote.command('allowlist').description('管理当前绑定小程序的预览白名单'));
13260
13252
  addRemotePublicOptions(allowlist.command('list').description('查看预览白名单')).action(createRemoteAction(handlers, resolveLogger, 'allowlist:list'));
13261
13253
  addRemotePublicOptions(allowlist.command('add').description('添加预览白名单 Heybox ID').argument('<heybox-id...>', 'Heybox ID')).action(createRemoteAction(handlers, resolveLogger, 'allowlist:add', (_command, heyboxIds) => ({
@@ -13300,6 +13292,9 @@ function installRemoteCommands(program, handlers, resolveLogger) {
13300
13292
  })));
13301
13293
  addRemotePublicOptions(remote.command('take-down').description('下架当前在线小程序').option('--yes', '跳过危险操作确认')).action(createRemoteAction(handlers, resolveLogger, 'take-down', (command) => readYesOption(command)));
13302
13294
  addRemotePublicOptions(remote.command('reopen').description('重新上架已下架小程序').option('--yes', '跳过危险操作确认')).action(createRemoteAction(handlers, resolveLogger, 'reopen', (command) => readYesOption(command)));
13295
+ const square = addRemotePublicOptions(remote.command('square').description('管理当前绑定小程序的广场展示状态'));
13296
+ addRemotePublicOptions(square.command('hide').description('隐藏当前小程序在普通用户侧的小程序工坊广场展示').option('--yes', '跳过危险操作确认')).action(createRemoteAction(handlers, resolveLogger, 'square:hide', (command) => readYesOption(command)));
13297
+ addRemotePublicOptions(square.command('show').description('恢复当前小程序在普通用户侧的小程序工坊广场展示')).action(createRemoteAction(handlers, resolveLogger, 'square:show'));
13303
13298
  }
13304
13299
  function createRemoteAction(handlers, resolveLogger, commandName, getCommandOptions = () => ({})) {
13305
13300
  return withUpdateReminder(async (...args) => {
@@ -13377,31 +13372,31 @@ function createCommandLoggerResolver(options) {
13377
13372
  };
13378
13373
  }
13379
13374
  const defaultClearLoginStatus = async (...args) => {
13380
- const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-CvUTmVDe.cjs'); });
13375
+ const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-Dwx2nD5p.cjs'); });
13381
13376
  return clearLoginStatus(...args);
13382
13377
  };
13383
13378
  const defaultLoginToHeybox = async (...args) => {
13384
- const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-CvUTmVDe.cjs'); });
13379
+ const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-Dwx2nD5p.cjs'); });
13385
13380
  return loginToHeybox(...args);
13386
13381
  };
13387
13382
  const defaultPrintLoginStatus = async (...args) => {
13388
- const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-CvUTmVDe.cjs'); });
13383
+ const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-Dwx2nD5p.cjs'); });
13389
13384
  return printLoginStatus(...args);
13390
13385
  };
13391
13386
  const defaultRunCreateCommand = async (...args) => {
13392
- const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-DS-dZw7W.cjs'); });
13387
+ const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-DxRc3VpZ.cjs'); });
13393
13388
  return runCreateCommand(...args);
13394
13389
  };
13395
13390
  const defaultRunDevCommand = async (...args) => {
13396
- const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-CWXTB0AZ.cjs'); });
13391
+ const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-C9Jkdl7Y.cjs'); });
13397
13392
  return runDevCommand(...args);
13398
13393
  };
13399
13394
  const defaultRunDoctorCommand = async (...args) => {
13400
- const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-CJWXCZQI.cjs'); });
13395
+ const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-DoiRoJd5.cjs'); });
13401
13396
  return runDoctorCommand(...args);
13402
13397
  };
13403
13398
  const defaultRunRemoteCommand = async (...args) => {
13404
- const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-TcGy7SWm.cjs'); }).then(function (n) { return n.remote; });
13399
+ const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-C5pPFOvG.cjs'); }).then(function (n) { return n.remote; });
13405
13400
  return runRemoteCommand(...args);
13406
13401
  };
13407
13402
  function resolveStandaloneLogger(options, verbose) {
@@ -3,9 +3,9 @@
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 session = require('./session-DIGS_hBV.cjs');
6
+ var session = require('./session-tV_vO27h.cjs');
7
7
  var browser = require('./browser-RAy8e8cV.cjs');
8
- var index = require('./index-D-F9nQns.cjs');
8
+ var index = require('./index-Dyn_R89O.cjs');
9
9
  require('node:path');
10
10
  require('fs');
11
11
  require('constants');
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var promises = require('node:readline/promises');
4
- var session = require('./session-DIGS_hBV.cjs');
4
+ var session = require('./session-tV_vO27h.cjs');
5
5
  var childProcess = require('node:child_process');
6
6
  var fs = require('node:fs');
7
7
  var fs$1 = require('node:fs/promises');
8
8
  var path = require('node:path');
9
- var index = require('./index-D-F9nQns.cjs');
9
+ var index = require('./index-Dyn_R89O.cjs');
10
10
 
11
11
  var re = {exports: {}};
12
12
 
@@ -2817,9 +2817,7 @@ function parseMiniappManifestJson(raw, sourceLabel = 'manifest.json') {
2817
2817
  throw new Error(`${sourceLabel} 必须是 JSON 对象`);
2818
2818
  }
2819
2819
  return {
2820
- manifest: {
2821
- version: parsed.version,
2822
- },
2820
+ manifest: parsed,
2823
2821
  hadBom,
2824
2822
  };
2825
2823
  }
@@ -2865,7 +2863,6 @@ const DEVELOPER_ENTITY_LIST_API_PATH = '/mall/developer/entity/list';
2865
2863
  const DEVELOPER_ENTITY_SWITCH_API_PATH = '/mall/developer/entity/switch';
2866
2864
  const LIST_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/list';
2867
2865
  const CREATE_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/create';
2868
- const UPDATE_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/update';
2869
2866
  const DETAIL_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/detail';
2870
2867
  const USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = '/mall/developer/user_miniprogram/preview_allowlist';
2871
2868
  const UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = '/mall/developer/user_miniprogram/preview_allowlist/update';
@@ -2876,6 +2873,7 @@ const WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_minipro
2876
2873
  const RELEASE_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_miniprogram/version/release';
2877
2874
  const TAKE_DOWN_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/take_down';
2878
2875
  const REOPEN_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/reopen';
2876
+ const UPDATE_SQUARE_DISPLAY_API_PATH = '/mall/developer/user_miniprogram/square_display/update';
2879
2877
  const LIST_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_miniprogram/version/list';
2880
2878
  const FNV_OFFSET = 0x811c9dc5;
2881
2879
  const FNV_PRIME = 0x01000193;
@@ -3113,7 +3111,7 @@ async function createDefaultCosClient(uploadToken) {
3113
3111
  };
3114
3112
  }
3115
3113
  async function loadCosConstructor() {
3116
- const cosModule = await Promise.resolve().then(function () { return require('./index-CQjVwycx.cjs'); }).then(function (n) { return n.index; });
3114
+ const cosModule = await Promise.resolve().then(function () { return require('./index-DLZbkW1t.cjs'); }).then(function (n) { return n.index; });
3117
3115
  return cosModule.default;
3118
3116
  }
3119
3117
  function formatSize(bytes) {
@@ -3158,6 +3156,9 @@ function isRecord(value) {
3158
3156
 
3159
3157
  async function precheckUserMiniprogramVersion$1(options, runtime = {}) {
3160
3158
  return postUserMiniprogramVersionForm(PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH, options, {
3159
+ name: options.name,
3160
+ icon_url: options.iconUrl,
3161
+ cover_image_urls: options.coverImageUrls.join(','),
3161
3162
  version: options.version,
3162
3163
  release_note: options.releaseNote,
3163
3164
  auto_publish: String(options.autoPublish),
@@ -3165,6 +3166,9 @@ async function precheckUserMiniprogramVersion$1(options, runtime = {}) {
3165
3166
  }
3166
3167
  async function submitUserMiniprogramAudit$1(options, runtime = {}) {
3167
3168
  return postUserMiniprogramVersionForm(SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, options, {
3169
+ name: options.name,
3170
+ icon_url: options.iconUrl,
3171
+ cover_image_urls: options.coverImageUrls.join(','),
3168
3172
  manifest: JSON.stringify(options.manifest),
3169
3173
  release_note: options.releaseNote,
3170
3174
  auto_publish: String(options.autoPublish),
@@ -3226,6 +3230,7 @@ async function runDeployCommand(options, runtime = {}) {
3226
3230
  if (typeof miniProgramId !== 'string' || !miniProgramId.trim()) {
3227
3231
  throw new Error('未在 package.json 中找到 heybox.miniProgramId,请先配置 mini program id');
3228
3232
  }
3233
+ const miniProgramProfile = readMiniProgramVersionProfile(packageJson);
3229
3234
  const releaseNote = await resolveDeployReleaseNote(options, runtime);
3230
3235
  const session$1 = await logger.task('正在校验 Heybox 登录态', () => (runtime.requireAuthSession ?? session.requireHeyboxAuthSession)({ loginBaseUrl }), { successText: 'Heybox 登录态有效' });
3231
3236
  logger.debug(`Heybox API: ${apiBaseUrl}`);
@@ -3239,6 +3244,7 @@ async function runDeployCommand(options, runtime = {}) {
3239
3244
  await runVersionPrecheck({
3240
3245
  session: session$1,
3241
3246
  miniProgramId,
3247
+ ...miniProgramProfile,
3242
3248
  version: precheckVersion,
3243
3249
  releaseNote,
3244
3250
  autoPublish,
@@ -3257,6 +3263,7 @@ async function runDeployCommand(options, runtime = {}) {
3257
3263
  await runVersionPrecheck({
3258
3264
  session: session$1,
3259
3265
  miniProgramId,
3266
+ ...miniProgramProfile,
3260
3267
  version: precheckVersion,
3261
3268
  releaseNote,
3262
3269
  autoPublish,
@@ -3294,7 +3301,7 @@ async function runDeployCommand(options, runtime = {}) {
3294
3301
  throw translateHeyboxDeployError(error, { projectRoot, stage: 'upload', version });
3295
3302
  }
3296
3303
  try {
3297
- submitAuditResult = await logger.task('正在提交审核', () => (runtime.submitUserMiniprogramAudit ?? submitUserMiniprogramAudit$1)({ session: session$1, miniProgramId, manifest, releaseNote, autoPublish }, { baseUrl: apiBaseUrl, fetchImpl: runtime.fetchImpl }), { successText: '审核提交完成' });
3304
+ submitAuditResult = await logger.task('正在提交审核', () => (runtime.submitUserMiniprogramAudit ?? submitUserMiniprogramAudit$1)({ session: session$1, miniProgramId, ...miniProgramProfile, manifest, releaseNote, autoPublish }, { baseUrl: apiBaseUrl, fetchImpl: runtime.fetchImpl }), { successText: '审核提交完成' });
3298
3305
  }
3299
3306
  catch (error) {
3300
3307
  throw translateHeyboxDeployError(error, { projectRoot, stage: 'submitAudit', version });
@@ -3342,6 +3349,44 @@ function findProjectRoot(startDir) {
3342
3349
  async function readPackageJson(projectRoot) {
3343
3350
  return JSON.parse(await fs$1.readFile(path.join(projectRoot, 'package.json'), 'utf8'));
3344
3351
  }
3352
+ function readMiniProgramVersionProfile(packageJson) {
3353
+ const profile = packageJson.heybox?.miniProgramProfile;
3354
+ return {
3355
+ name: readRequiredProfileText(profile?.name, 'heybox.miniProgramProfile.name'),
3356
+ iconUrl: readRequiredHttpsUrl(profile?.iconUrl, 'heybox.miniProgramProfile.iconUrl'),
3357
+ coverImageUrls: readCoverImageUrls(profile?.coverImageUrls),
3358
+ };
3359
+ }
3360
+ function readRequiredProfileText(value, pathLabel) {
3361
+ const text = typeof value === 'string' ? value.trim() : '';
3362
+ if (!text) {
3363
+ throw new Error(`${pathLabel} 不能为空;请在 package.json 配置本次提交审核的小程序资料`);
3364
+ }
3365
+ return text;
3366
+ }
3367
+ function readRequiredHttpsUrl(value, pathLabel) {
3368
+ const text = readRequiredProfileText(value, pathLabel);
3369
+ if (!/^https:\/\//i.test(text)) {
3370
+ throw new Error(`${pathLabel} 必须是 HTTPS 地址`);
3371
+ }
3372
+ return text;
3373
+ }
3374
+ function readCoverImageUrls(value) {
3375
+ if (!Array.isArray(value)) {
3376
+ throw new Error('heybox.miniProgramProfile.coverImageUrls 至少配置 1 张 HTTPS 图片');
3377
+ }
3378
+ const urls = value
3379
+ .map((item) => (typeof item === 'string' ? item.trim() : ''))
3380
+ .filter(Boolean);
3381
+ if (urls.length === 0) {
3382
+ throw new Error('heybox.miniProgramProfile.coverImageUrls 至少配置 1 张 HTTPS 图片');
3383
+ }
3384
+ const invalidUrl = urls.find((url) => !/^https:\/\//i.test(url));
3385
+ if (invalidUrl) {
3386
+ throw new Error(`heybox.miniProgramProfile.coverImageUrls 必须都是 HTTPS 地址:${invalidUrl}`);
3387
+ }
3388
+ return urls;
3389
+ }
3345
3390
  async function readDeployManifest(projectRoot, logger) {
3346
3391
  const distDir = path.join(projectRoot, 'dist');
3347
3392
  const manifestPath = path.join(distDir, 'manifest.json');
@@ -3544,8 +3589,7 @@ function createRemoteApiClient(options) {
3544
3589
  switchDeveloperEntity: (requestOptions) => switchDeveloperEntity(requestOptions, options),
3545
3590
  getDeveloperAccessStatus: () => getDeveloperAccessStatus(options),
3546
3591
  listUserMiniprograms: (requestOptions = {}) => listUserMiniprograms(requestOptions, options),
3547
- createUserMiniprogram: (requestOptions) => createUserMiniprogram(requestOptions, options),
3548
- updateUserMiniprogram: (requestOptions) => updateUserMiniprogram(requestOptions, options),
3592
+ createUserMiniprogram: () => createUserMiniprogram(options),
3549
3593
  getUserMiniprogramDetail: (requestOptions) => getUserMiniprogramDetail(requestOptions, options),
3550
3594
  getPreviewAllowlist: (requestOptions) => getPreviewAllowlist(requestOptions, options),
3551
3595
  updatePreviewAllowlist: (requestOptions) => updatePreviewAllowlist(requestOptions, options),
@@ -3556,6 +3600,7 @@ function createRemoteApiClient(options) {
3556
3600
  releaseUserMiniprogramVersion: (requestOptions) => releaseUserMiniprogramVersion(requestOptions, options),
3557
3601
  takeDownUserMiniprogram: (requestOptions) => takeDownUserMiniprogram(requestOptions, options),
3558
3602
  reopenUserMiniprogram: (requestOptions) => reopenUserMiniprogram(requestOptions, options),
3603
+ updateSquareDisplay: (requestOptions) => updateSquareDisplay(requestOptions, options),
3559
3604
  listUserMiniprogramVersions: (requestOptions) => listUserMiniprogramVersions(requestOptions, options),
3560
3605
  };
3561
3606
  }
@@ -3571,11 +3616,8 @@ async function getDeveloperAccessStatus(runtime) {
3571
3616
  async function listUserMiniprograms(options, runtime) {
3572
3617
  return remoteGet(LIST_USER_MINIPROGRAM_API_PATH, options, runtime);
3573
3618
  }
3574
- async function createUserMiniprogram(options, runtime) {
3575
- return remotePostForm(CREATE_USER_MINIPROGRAM_API_PATH, options, runtime);
3576
- }
3577
- async function updateUserMiniprogram(options, runtime) {
3578
- return remotePostForm(UPDATE_USER_MINIPROGRAM_API_PATH, options, runtime);
3619
+ async function createUserMiniprogram(runtime) {
3620
+ return remotePostForm(CREATE_USER_MINIPROGRAM_API_PATH, {}, runtime);
3579
3621
  }
3580
3622
  async function getUserMiniprogramDetail(options, runtime) {
3581
3623
  return remoteGet(DETAIL_USER_MINIPROGRAM_API_PATH, options, runtime);
@@ -3613,6 +3655,9 @@ async function takeDownUserMiniprogram(options, runtime) {
3613
3655
  async function reopenUserMiniprogram(options, runtime) {
3614
3656
  return remotePostForm(REOPEN_USER_MINIPROGRAM_API_PATH, options, runtime);
3615
3657
  }
3658
+ async function updateSquareDisplay(options, runtime) {
3659
+ return remotePostForm(UPDATE_SQUARE_DISPLAY_API_PATH, options, runtime);
3660
+ }
3616
3661
  async function listUserMiniprogramVersions(options, runtime) {
3617
3662
  return remoteGet(LIST_USER_MINIPROGRAM_VERSION_API_PATH, options, runtime);
3618
3663
  }
@@ -3811,8 +3856,6 @@ async function runRemoteCommand(options, runtime = {}) {
3811
3856
  return remoteBind(options, context, runtime);
3812
3857
  case 'info':
3813
3858
  return remoteInfo(options, context, runtime);
3814
- case 'update':
3815
- return remoteUpdate(options, context, runtime);
3816
3859
  case 'allowlist:list':
3817
3860
  return remoteAllowlistList(options, context, runtime);
3818
3861
  case 'allowlist:add':
@@ -3828,6 +3871,9 @@ async function runRemoteCommand(options, runtime = {}) {
3828
3871
  case 'take-down':
3829
3872
  case 'reopen':
3830
3873
  return remoteDangerousWrite(options, context, runtime);
3874
+ case 'square:hide':
3875
+ case 'square:show':
3876
+ return remoteSquareWrite(options, context, runtime);
3831
3877
  default:
3832
3878
  throw new Error(`不支持的 remote 命令:${String(options.command)}`);
3833
3879
  }
@@ -3894,8 +3940,7 @@ function adaptRemoteApiClient(api) {
3894
3940
  return {
3895
3941
  accessStatus: () => api.getDeveloperAccessStatus(),
3896
3942
  listMiniPrograms: ({ keyword, limit = 200, offset = 0, status }) => api.listUserMiniprograms({ keyword, status, offset, limit }),
3897
- createMiniProgram: ({ name, previewImageUrl }) => api.createUserMiniprogram({ name, ...(previewImageUrl ? { preview_image_url: previewImageUrl } : {}) }),
3898
- updateMiniProgram: ({ miniProgramId, name, previewImageUrl }) => api.updateUserMiniprogram({ mini_program_id: miniProgramId, name, preview_image_url: previewImageUrl }),
3943
+ createMiniProgram: () => api.createUserMiniprogram(),
3899
3944
  getMiniProgramDetail: (miniProgramId) => api.getUserMiniprogramDetail({ mini_program_id: miniProgramId }),
3900
3945
  getAllowlist: (miniProgramId) => api.getPreviewAllowlist({ mini_program_id: miniProgramId }),
3901
3946
  updateAllowlist: ({ miniProgramId, heyboxIds }) => api.updatePreviewAllowlist({ mini_program_id: miniProgramId, heybox_ids: heyboxIds }),
@@ -3907,6 +3952,7 @@ function adaptRemoteApiClient(api) {
3907
3952
  withdrawVersion: ({ miniProgramId, reason, version }) => api.withdrawUserMiniprogramVersion({ mini_program_id: miniProgramId, version, reason }),
3908
3953
  takeDown: (miniProgramId) => api.takeDownUserMiniprogram({ mini_program_id: miniProgramId }),
3909
3954
  reopen: (miniProgramId) => api.reopenUserMiniprogram({ mini_program_id: miniProgramId }),
3955
+ updateSquareDisplay: ({ miniProgramId, isHidden }) => api.updateSquareDisplay({ mini_program_id: miniProgramId, is_hidden: isHidden }),
3910
3956
  };
3911
3957
  }
3912
3958
  async function remoteAccess(options, context, runtime) {
@@ -4008,14 +4054,12 @@ async function remoteCreate(options, context, runtime) {
4008
4054
  if (context.binding && !options.forceBind) {
4009
4055
  throw new Error(`当前项目已绑定 ${context.binding};如需覆盖,请使用 --force-bind`);
4010
4056
  }
4011
- const name = requireNonEmpty(options.name, 'remote create 必须传 --name <name>');
4012
- const previewImageUrl = validateOptionalHttpsUrl(options.previewImageUrl, '--preview-image-url');
4013
4057
  const access = await context.api.accessStatus();
4014
4058
  if (access.status !== 'approved') {
4015
4059
  throw new Error(`当前 CLI 用户没有创建工坊小程序权限:${String(access.status ?? 'unknown')}`);
4016
4060
  }
4017
4061
  await confirmCreateWithCurrentEntity(options, context, runtime);
4018
- const result = await context.api.createMiniProgram({ name, previewImageUrl });
4062
+ const result = await context.api.createMiniProgram();
4019
4063
  const miniProgramId = requireMiniProgramId(result);
4020
4064
  await writeBoundMiniProgramId(context.packageJson.projectRoot, miniProgramId, { force: options.forceBind });
4021
4065
  const output = { changed: true, miniProgramId, remote: toCamelCaseDeep(result) };
@@ -4051,25 +4095,6 @@ async function remoteInfo(options, context, runtime) {
4051
4095
  }
4052
4096
  return finishRemoteCommand(options, runtime, output);
4053
4097
  }
4054
- async function remoteUpdate(options, context, runtime) {
4055
- const miniProgramId = requireBinding(context);
4056
- const hasName = options.name !== undefined;
4057
- const hasPreviewImageUrl = options.previewImageUrl !== undefined;
4058
- if (!hasName && !hasPreviewImageUrl) {
4059
- throw new Error('remote update 至少需要传 --name 或 --preview-image-url');
4060
- }
4061
- const detail = await context.api.getMiniProgramDetail(miniProgramId);
4062
- const nextName = hasName ? requireNonEmpty(options.name, '--name 不能为空') : requireNonEmpty(detail.name, '远端详情缺少 name,无法补全 update 请求');
4063
- const nextPreviewImageUrl = hasPreviewImageUrl
4064
- ? validateOptionalHttpsUrl(options.previewImageUrl, '--preview-image-url') ?? ''
4065
- : String(detail.preview_image_url ?? '');
4066
- const result = await context.api.updateMiniProgram({ miniProgramId, name: nextName, previewImageUrl: nextPreviewImageUrl });
4067
- const output = { changed: true, miniProgramId, remote: toCamelCaseDeep(result) };
4068
- if (!options.json) {
4069
- context.logger.success(`更新成功:${miniProgramId}`);
4070
- }
4071
- return finishRemoteCommand(options, runtime, output);
4072
- }
4073
4098
  async function remoteAllowlistList(options, context, runtime) {
4074
4099
  const miniProgramId = requireBinding(context);
4075
4100
  const result = await context.api.getAllowlist(miniProgramId);
@@ -4157,6 +4182,25 @@ async function remoteDangerousWrite(options, context, runtime) {
4157
4182
  const result = await context.api.reopen(miniProgramId);
4158
4183
  return finishDangerousWrite(options, runtime, context.logger, miniProgramId, result, { status: result.status });
4159
4184
  }
4185
+ async function remoteSquareWrite(options, context, runtime) {
4186
+ const miniProgramId = requireBinding(context);
4187
+ const isHidden = options.command === 'square:hide';
4188
+ if (isHidden) {
4189
+ const detail = await context.api.getMiniProgramDetail(miniProgramId);
4190
+ await confirmDangerousRemoteChange(options, runtime, context.logger, {
4191
+ miniProgramId,
4192
+ name: detail.name,
4193
+ operation: 'square hide',
4194
+ status: detail.status,
4195
+ });
4196
+ }
4197
+ const result = await context.api.updateSquareDisplay({ miniProgramId, isHidden });
4198
+ const output = { changed: true, isHidden: result.is_hidden === true, miniProgramId, remote: toCamelCaseDeep(result) };
4199
+ if (!options.json) {
4200
+ context.logger.success(`${isHidden ? '隐藏' : '展示'}广场展示状态成功:${miniProgramId}`);
4201
+ }
4202
+ return finishRemoteCommand(options, runtime, output);
4203
+ }
4160
4204
  function finishDangerousWrite(options, runtime, logger, miniProgramId, result, extras) {
4161
4205
  const output = { changed: true, miniProgramId, ...extras, remote: toCamelCaseDeep(result) };
4162
4206
  if (!options.json) {
@@ -4380,23 +4424,6 @@ function requireNonEmpty(value, message) {
4380
4424
  }
4381
4425
  return normalized;
4382
4426
  }
4383
- function validateOptionalHttpsUrl(value, label) {
4384
- if (value === undefined) {
4385
- return undefined;
4386
- }
4387
- const raw = requireNonEmpty(value, `${label} 不能为空`);
4388
- let url;
4389
- try {
4390
- url = new URL(raw);
4391
- }
4392
- catch {
4393
- throw new Error(`${label} 必须是合法 HTTPS URL`);
4394
- }
4395
- if (url.protocol !== 'https:') {
4396
- throw new Error(`${label} 只接受 HTTPS URL`);
4397
- }
4398
- return raw;
4399
- }
4400
4427
  function parseHeyboxIds(values) {
4401
4428
  if (values.length === 0) {
4402
4429
  throw new Error('请传入至少一个十进制 heybox_id');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D-F9nQns.cjs');
3
+ var index = require('./index-Dyn_R89O.cjs');
4
4
  var node_crypto = require('node:crypto');
5
5
  var path = require('node:path');
6
6
  var require$$0$2 = require('fs');
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./cli-chunks/index-D-F9nQns.cjs');
3
+ var index = require('./cli-chunks/index-Dyn_R89O.cjs');
4
4
  require('node:module');
5
5
  require('node:fs');
6
6
  require('node:fs/promises');
@@ -2818,7 +2818,6 @@ const DEVELOPER_ENTITY_LIST_API_PATH = '/mall/developer/entity/list';
2818
2818
  const DEVELOPER_ENTITY_SWITCH_API_PATH = '/mall/developer/entity/switch';
2819
2819
  const LIST_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/list';
2820
2820
  const CREATE_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/create';
2821
- const UPDATE_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/update';
2822
2821
  const DETAIL_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/detail';
2823
2822
  const USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = '/mall/developer/user_miniprogram/preview_allowlist';
2824
2823
  const UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = '/mall/developer/user_miniprogram/preview_allowlist/update';
@@ -2829,6 +2828,7 @@ const WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_minipro
2829
2828
  const RELEASE_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_miniprogram/version/release';
2830
2829
  const TAKE_DOWN_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/take_down';
2831
2830
  const REOPEN_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/reopen';
2831
+ const UPDATE_SQUARE_DISPLAY_API_PATH = '/mall/developer/user_miniprogram/square_display/update';
2832
2832
  const LIST_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_miniprogram/version/list';
2833
2833
  const FNV_OFFSET = 0x811c9dc5;
2834
2834
  const FNV_PRIME = 0x01000193;
@@ -2914,7 +2914,7 @@ exports.RELEASE_USER_MINIPROGRAM_VERSION_API_PATH = RELEASE_USER_MINIPROGRAM_VER
2914
2914
  exports.REOPEN_USER_MINIPROGRAM_API_PATH = REOPEN_USER_MINIPROGRAM_API_PATH;
2915
2915
  exports.SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH = SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH;
2916
2916
  exports.TAKE_DOWN_USER_MINIPROGRAM_API_PATH = TAKE_DOWN_USER_MINIPROGRAM_API_PATH;
2917
- exports.UPDATE_USER_MINIPROGRAM_API_PATH = UPDATE_USER_MINIPROGRAM_API_PATH;
2917
+ exports.UPDATE_SQUARE_DISPLAY_API_PATH = UPDATE_SQUARE_DISPLAY_API_PATH;
2918
2918
  exports.UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH;
2919
2919
  exports.USER_MINIPROGRAM_ACCESS_STATUS_API_PATH = USER_MINIPROGRAM_ACCESS_STATUS_API_PATH;
2920
2920
  exports.USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH;
@@ -2816,7 +2816,6 @@ const DEVELOPER_ENTITY_LIST_API_PATH = '/mall/developer/entity/list';
2816
2816
  const DEVELOPER_ENTITY_SWITCH_API_PATH = '/mall/developer/entity/switch';
2817
2817
  const LIST_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/list';
2818
2818
  const CREATE_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/create';
2819
- const UPDATE_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/update';
2820
2819
  const DETAIL_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/detail';
2821
2820
  const USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = '/mall/developer/user_miniprogram/preview_allowlist';
2822
2821
  const UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = '/mall/developer/user_miniprogram/preview_allowlist/update';
@@ -2827,6 +2826,7 @@ const WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_minipro
2827
2826
  const RELEASE_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_miniprogram/version/release';
2828
2827
  const TAKE_DOWN_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/take_down';
2829
2828
  const REOPEN_USER_MINIPROGRAM_API_PATH = '/mall/developer/user_miniprogram/reopen';
2829
+ const UPDATE_SQUARE_DISPLAY_API_PATH = '/mall/developer/user_miniprogram/square_display/update';
2830
2830
  const LIST_USER_MINIPROGRAM_VERSION_API_PATH = '/mall/developer/user_miniprogram/version/list';
2831
2831
  const FNV_OFFSET = 0x811c9dc5;
2832
2832
  const FNV_PRIME = 0x01000193;
@@ -2897,4 +2897,4 @@ function shouldUploadDistFile(relativePath) {
2897
2897
  return true;
2898
2898
  }
2899
2899
 
2900
- export { ACTIVITY_UPLOAD_KEY_MAX_LENGTH, CREATE_USER_MINIPROGRAM_API_PATH, DETAIL_USER_MINIPROGRAM_API_PATH, DEVELOPER_ENTITY_LIST_API_PATH, DEVELOPER_ENTITY_SWITCH_API_PATH, LIST_USER_MINIPROGRAM_API_PATH, LIST_USER_MINIPROGRAM_VERSION_API_PATH, MINIAPP_UPLOAD_BATCH_SIZE, MINIAPP_UPLOAD_SCOPE, MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES, PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH, RELEASE_USER_MINIPROGRAM_VERSION_API_PATH, REOPEN_USER_MINIPROGRAM_API_PATH, SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, TAKE_DOWN_USER_MINIPROGRAM_API_PATH, UPDATE_USER_MINIPROGRAM_API_PATH, UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_ACCESS_STATUS_API_PATH, USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_VERSION_PREVIEW_INFO_API_PATH, WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH, getMiniProgramUploadAlias, getMiniappUploadKey, isValidMiniappManifestVersion as isValidVersion, normalizeRelativePath, relativePathContainsNodeModulesSegment, shouldUploadDistFile, validateUploadPaths, validateUploadTotalSize };
2900
+ export { ACTIVITY_UPLOAD_KEY_MAX_LENGTH, CREATE_USER_MINIPROGRAM_API_PATH, DETAIL_USER_MINIPROGRAM_API_PATH, DEVELOPER_ENTITY_LIST_API_PATH, DEVELOPER_ENTITY_SWITCH_API_PATH, LIST_USER_MINIPROGRAM_API_PATH, LIST_USER_MINIPROGRAM_VERSION_API_PATH, MINIAPP_UPLOAD_BATCH_SIZE, MINIAPP_UPLOAD_SCOPE, MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES, PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH, RELEASE_USER_MINIPROGRAM_VERSION_API_PATH, REOPEN_USER_MINIPROGRAM_API_PATH, SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, TAKE_DOWN_USER_MINIPROGRAM_API_PATH, UPDATE_SQUARE_DISPLAY_API_PATH, UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_ACCESS_STATUS_API_PATH, USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_VERSION_PREVIEW_INFO_API_PATH, WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH, getMiniProgramUploadAlias, getMiniappUploadKey, isValidMiniappManifestVersion as isValidVersion, normalizeRelativePath, relativePathContainsNodeModulesSegment, shouldUploadDistFile, validateUploadPaths, validateUploadTotalSize };
@@ -21,7 +21,7 @@ npm run deploy
21
21
 
22
22
  - `npm run dev`:启动本地 Vite 服务和 `hb-sdk` 内置 mock runtime host,适合本地调试 SDK 能力;调试页内可点击按钮在 Mac 版 APP 中启动同一页面,也可以选择局域网网卡后用手机小黑盒 APP 扫码调试。手机需要与电脑处在同一局域网,并使用支持小程序调试壳的新版小黑盒 APP。Codex、VSCode 等内嵌浏览器可能无法唤起系统 APP,需要时请在系统浏览器中打开同一个调试页后重试。
23
23
  - `npm run build`:先执行 TypeScript 检查,再构建生产产物。
24
- - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create --name "..."` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
24
+ - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。小程序名称、icon 和介绍图在 `package.json.heybox.miniProgramProfile` 中配置并随版本审核提交。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
25
25
 
26
26
  ## 更多能力
27
27
 
@@ -4,7 +4,12 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "heybox": {
7
- "miniProgramId": ""
7
+ "miniProgramId": "",
8
+ "miniProgramProfile": {
9
+ "name": "<%= packageName %>",
10
+ "iconUrl": "",
11
+ "coverImageUrls": []
12
+ }
8
13
  },
9
14
  "scripts": {
10
15
  "hb-sdk": "hb-sdk",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heybox/hb-sdk",
3
- "version": "0.5.5",
3
+ "version": "0.5.8",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -121,6 +121,10 @@
121
121
  "test:unit": "NODE_OPTIONS='--conditions=heybox' vitest run",
122
122
  "test:unit:coverage": "NODE_OPTIONS='--conditions=heybox' vitest run --coverage",
123
123
  "test:vite": "vitest run --config vitest.vite.config.ts",
124
- "test:watch": "NODE_OPTIONS='--conditions=heybox' vitest"
124
+ "test:watch": "NODE_OPTIONS='--conditions=heybox' vitest",
125
+ "changelog:draft": "node scripts/changelog-draft.cjs",
126
+ "check:changelog": "node scripts/check-changelog.cjs",
127
+ "release:prepare": "node scripts/release-prepare.cjs",
128
+ "release:tag": "node scripts/release-tag.cjs"
125
129
  }
126
130
  }
package/skill/SKILL.md CHANGED
@@ -50,8 +50,8 @@ Apply these instructions when writing, reviewing, or debugging code that consume
50
50
  2. Use `hb-sdk dev` for local browser debugging through the built-in mock runtime host.
51
51
  3. Use `hb-sdk remote ...` for developer-owned remote mini-program management. Top-level `hb-sdk deploy` has been hard-cut and must not be recommended as a compatibility alias.
52
52
  4. Use `hb-sdk remote entity list`, `hb-sdk remote entity current`, and `hb-sdk remote entity switch <entity-id>` to inspect or change the developer platform server-side current entity before remote management commands.
53
- 5. Use `hb-sdk remote create --name <name>` to create a remote mini-program under the server-side current entity and bind the returned id into `package.json.heybox.miniProgramId`; use `hb-sdk remote bind <mini-program-id>` to bind an existing remote mini-program after current-entity manageability is verified.
54
- 6. Use `hb-sdk remote info`, `hb-sdk remote update`, `hb-sdk remote list`, `hb-sdk remote access`, `hb-sdk remote versions`, `hb-sdk remote preview <version>`, and `hb-sdk remote allowlist ...` for read/basic/preview management workflows. Discovery commands show the server-side current entity scope; write commands target the current project binding rather than arbitrary ids.
53
+ 5. Use `hb-sdk remote create` to create a remote mini-program under the server-side current entity and bind the returned id into `package.json.heybox.miniProgramId`; use `hb-sdk remote bind <mini-program-id>` to bind an existing remote mini-program after current-entity manageability is verified. Mini-program name, icon, and cover images belong in `package.json.heybox.miniProgramProfile` and are submitted with version audit.
54
+ 6. Use `hb-sdk remote info`, `hb-sdk remote list`, `hb-sdk remote access`, `hb-sdk remote versions`, `hb-sdk remote preview <version>`, and `hb-sdk remote allowlist ...` for read/basic/preview management workflows. Mini-program name and image changes must go through version audit, so the CLI must not expose a basic-info update command.
55
55
  7. Use `hb-sdk remote deploy --release-note <text>` to build, upload, and submit the current project for audit. It reads `package.json.heybox.miniProgramId`, validates that the bound mini-program belongs to the server-side current entity before precheck/build/upload, prechecks `package.json.version` before build, runs the project's `build` script via the package manager auto-detected by lockfile, uploads `dist/` to CDN (skipping `manifest.json`, `.DS_Store`, `.map`), then calls the submit-audit API. The deploy upload pipeline rejects actual upload artifacts over 100MiB before any upload request, processes CDN upload metadata and callback confirmation at 50 files per batch, keeps 4-way upload concurrency within each batch, and validates CDN-returned keys exactly against the local expected upload keys.
56
56
  8. Use `hb-sdk remote deploy --skip-build --release-note <text>` only when the `dist/` directory is already prepared by an upstream CI stage. In this mode the CLI reads `dist/manifest.json.version` before precheck. Missing `dist/manifest.json` or `dist/index.html` aborts the run.
57
57
  9. Always provide a concise release note before deploy. Non-interactive environments must pass `--release-note`; interactive terminals may prompt for it. The default is manual release after approval with `hb-sdk remote release <version>`; use `--auto-publish` when the audited version should automatically release after approval.
@@ -103,17 +103,18 @@ For host/runtime/protocol-maintenance code:
103
103
  2. When modifying docs, skill instructions, CLI guidance, or public agent-skill sync points, start with:
104
104
  - `pnpm --filter @heybox/hb-sdk run check:docs-sync`
105
105
  - `cat packages/hb-sdk/DOC_SYNC_CHECKLIST.md`
106
- 3. When modifying this repo's source skill at `packages/hb-sdk/skill` and preparing distributable artifacts, also run:
106
+ 3. When preparing a package release, run `pnpm --filter @heybox/hb-sdk run release:prepare -- --bump patch` or `pnpm --filter @heybox/hb-sdk run release:prepare -- --version <x.y.z>`. The release assistant updates both package versions, inserts `packages/hb-sdk/CHANGELOG.md`, and runs `check:changelog`. Use `--ai-command "<command>"` or `HB_SDK_CHANGELOG_AI_COMMAND` when an AI writer should rewrite the Conventional Commit draft. Review the entry for Mini-program developers and Host/Runtime integration maintainers, and do not expose Runtime internal adapter, state-machine, or security-policy details.
107
+ 4. When modifying this repo's source skill at `packages/hb-sdk/skill` and preparing distributable artifacts, also run:
107
108
  - `node packages/hb-sdk/skill/scripts/package-skill.mjs`
108
- 4. When modifying CLI, mock runtime, package exports, or package dependency direction, also run:
109
+ 5. When modifying CLI, mock runtime, package exports, or package dependency direction, also run:
109
110
  - `pnpm --filter @heybox/hb-sdk run check:boundary`
110
111
  - `pnpm --filter @heybox/hb-sdk run test:unit`
111
- 5. Inspect the generated zip before distribution:
112
+ 6. Inspect the generated zip before distribution:
112
113
  - `unzip -l packages/hb-sdk/hb-sdk.zip | sed -n '1,120p'`
113
- 6. When adding or modifying the deploy command or its upload pipeline, also run:
114
+ 7. When adding or modifying the deploy command or its upload pipeline, also run:
114
115
  - `pnpm --filter @heybox/hb-sdk run check:boundary`
115
116
  - `pnpm --filter @heybox/hb-sdk run test:unit`
116
117
  - Verify `dist/cli.cjs` does not have any `require('cos-nodejs-sdk-v5')` left after `build:cli`; the boundary check enforces this automatically.
117
- 7. Verify public payload sync before publishing:
118
+ 8. Verify public payload sync before publishing:
118
119
  - `pnpm --filter @heybox-spa/open run sync:agent-skills`
119
120
  - `pnpm --filter @heybox-spa/open run check:agent-skills`
@@ -19,7 +19,7 @@
19
19
  ## Package metadata
20
20
 
21
21
  - Package: `@heybox/hb-sdk`
22
- - Version at generation time: `0.5.5`
22
+ - Version at generation time: `0.5.7`
23
23
  - Public root export: `@heybox/hb-sdk`
24
24
  - Protocol export: `@heybox/hb-sdk/protocol`
25
25
  - Vite plugin export: `@heybox/hb-sdk/vite`
@@ -49,10 +49,9 @@ hb-sdk remote entity list
49
49
  hb-sdk remote entity current
50
50
  hb-sdk remote entity switch <entity-id>
51
51
  hb-sdk remote list [--status <status>] [--keyword <text>]
52
- hb-sdk remote create --name <name> [--preview-image-url <url>] [--yes] [--force-bind]
52
+ hb-sdk remote create [--yes] [--force-bind]
53
53
  hb-sdk remote bind <mini-program-id> [--force]
54
54
  hb-sdk remote info
55
- hb-sdk remote update [--name <name>] [--preview-image-url <url>]
56
55
  hb-sdk remote allowlist list
57
56
  hb-sdk remote allowlist add <heybox-id...>
58
57
  hb-sdk remote allowlist remove <heybox-id...>
@@ -64,6 +63,8 @@ hb-sdk remote release <version> [--yes]
64
63
  hb-sdk remote withdraw <version> [--yes] [--reason <text>]
65
64
  hb-sdk remote take-down [--yes]
66
65
  hb-sdk remote reopen [--yes]
66
+ hb-sdk remote square hide [--yes]
67
+ hb-sdk remote square show
67
68
 
68
69
  Removed: hb-sdk deploy
69
70
  ```
@@ -166,7 +167,7 @@ HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1 hb-sdk remote deploy --api-base-url http://12
166
167
 
167
168
  默认发布策略是 `auto_publish=false`:运营审核通过后使用 `hb-sdk remote versions` 查看版本状态,再用 `hb-sdk remote release <version>` 发布。需要审核通过后自动发布并下架旧线上版本时,使用 `--auto-publish`。如需让指定用户预览未发布候选版本,使用 `hb-sdk remote allowlist add <heybox_id>` 管理预览白名单。
168
169
 
169
- 内部测试或预发环境可通过 `HB_SDK_API_BASE_URL` / `HB_SDK_LOGIN_BASE_URL` 设置默认后台环境,也可以用 `--api-base-url` / `--login-base-url` 覆盖单次命令。自定义地址只接受 origin,不允许包含 path、query 或 hash;API origin 默认还必须是 Heybox 受信 HTTPS 域名,只有本地联调等场景可显式使用 `--allow-unsafe-api-base-url` 或 `HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1` 放开。`apiBaseUrl` 影响 `hb-sdk remote` 里的远端平台后台 API,包括预检、CDN 上传凭证/回调、提交审核、版本、发布、撤回、下架、重新上架、详情、基础信息和白名单等调用;`loginBaseUrl` 用于 `hb-sdk login` 的登录入口,以及 remote 命令前校验当前 CLI 登录态是否属于同一个登录环境。开发环境如需给后台请求带 `x-rylai-service-tag` 和 `special_tag`,可在 `packages/hb-sdk/src/cli/config.ts` 里按 `@heybox/hb-types` 的 `RylaiServiceTagConfig` 配置 `default_tag` 或 path-prefix 级 `special_tag`。日志只输出 origin,不输出带身份和签名参数的完整请求 URL。
170
+ 内部测试或预发环境可通过 `HB_SDK_API_BASE_URL` / `HB_SDK_LOGIN_BASE_URL` 设置默认后台环境,也可以用 `--api-base-url` / `--login-base-url` 覆盖单次命令。自定义地址只接受 origin,不允许包含 path、query 或 hash;API origin 默认还必须是 Heybox 受信 HTTPS 域名,只有本地联调等场景可显式使用 `--allow-unsafe-api-base-url` 或 `HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1` 放开。`apiBaseUrl` 影响 `hb-sdk remote` 里的远端平台后台 API,包括预检、CDN 上传凭证/回调、提交审核、版本、发布、撤回、下架、重新上架、详情和白名单等调用;`loginBaseUrl` 用于 `hb-sdk login` 的登录入口,以及 remote 命令前校验当前 CLI 登录态是否属于同一个登录环境。开发环境如需给后台请求带 `x-rylai-service-tag` 和 `special_tag`,可在 `packages/hb-sdk/src/cli/config.ts` 里按 `@heybox/hb-types` 的 `RylaiServiceTagConfig` 配置 `default_tag` 或 path-prefix 级 `special_tag`。日志只输出 origin,不输出带身份和签名参数的完整请求 URL。
170
171
 
171
172
  `hb-sdk doctor`、npm latest 检查、mock host 的 `network.request()` 不受这些配置影响。
172
173
 
@@ -202,7 +203,7 @@ The authoritative current entity is the developer platform server-side current e
202
203
 
203
204
  Agent rules:
204
205
 
205
- - Treat the server-side current entity as the authority for remote create, bind, deploy, list, access, versions, preview, release, withdraw, take-down, and reopen workflows.
206
+ - Treat the server-side current entity as the authority for remote create, bind, deploy, list, access, versions, preview, release, withdraw, take-down, reopen, and square-display workflows.
206
207
  - Treat CLI `selectedEntity` as a display/debug snapshot only; it can drift from the server-side current entity and must not be used as a permission source.
207
208
  - Use `hb-sdk remote entity current` when a user needs to confirm which entity create/deploy will use.
208
209
  - Use `hb-sdk remote entity switch <entity-id>` to change entity scope. Do not recommend `--entity-id` or an environment variable as a remote command override.
@@ -219,10 +220,9 @@ Agent rules:
219
220
  ```bash
220
221
  hb-sdk remote access
221
222
  hb-sdk remote list
222
- hb-sdk remote create --name "我的小程序"
223
+ hb-sdk remote create
223
224
  hb-sdk remote bind mp_xxxxxxxx
224
225
  hb-sdk remote info
225
- hb-sdk remote update --name "新名称"
226
226
  hb-sdk remote allowlist add 12345678
227
227
  hb-sdk remote versions
228
228
  hb-sdk remote preview 1.2.3
@@ -230,23 +230,44 @@ hb-sdk remote release 1.2.3
230
230
  hb-sdk remote withdraw 1.2.3 --reason "需要修复说明"
231
231
  hb-sdk remote take-down
232
232
  hb-sdk remote reopen
233
+ hb-sdk remote square hide
234
+ hb-sdk remote square show
233
235
  ```
234
236
 
235
237
  `hb-sdk remote create` 会创建远端工坊小程序并写入当前项目绑定;已有绑定时必须传 `--force-bind` 才能覆盖。`hb-sdk remote bind <mini-program-id>` 会先校验当前 CLI 用户可管理目标小程序,再写入本地配置;`--force` 只允许覆盖本地绑定,不跳过远端校验。
236
238
 
237
- `hb-sdk remote release`、`hb-sdk remote withdraw`、`hb-sdk remote take-down` `hb-sdk remote reopen` 会改变审核、发布或用户侧可见状态。交互式终端会展示小程序 id、名称、当前状态、目标版本和操作,再要求确认;非 TTY 环境必须传 `--yes`。
239
+ 小程序名称、icon 和介绍图需要随版本提交审核,CLI 不再提供直接更新基础信息的命令。提交审核前在 `package.json.heybox.miniProgramProfile` 配置 `name`、HTTPS `iconUrl` 和至少一张 HTTPS `coverImageUrls`:
240
+
241
+ ```json
242
+ {
243
+ "heybox": {
244
+ "miniProgramId": "mp_xxxxxxxx",
245
+ "miniProgramProfile": {
246
+ "name": "我的小程序",
247
+ "iconUrl": "https://img.example.test/icon.png",
248
+ "coverImageUrls": ["https://img.example.test/cover.png"]
249
+ }
250
+ }
251
+ }
252
+ ```
253
+
254
+ `hb-sdk remote square hide` 会隐藏当前绑定小程序在普通用户侧的小程序工坊广场展示;白名单用户仍可在小程序工坊广场看到,直接链接访问已发布版本也不受影响。`hb-sdk remote square show` 会恢复普通用户侧的小程序工坊广场展示。
255
+
256
+ `hb-sdk remote release`、`hb-sdk remote withdraw`、`hb-sdk remote take-down`、`hb-sdk remote reopen` 和 `hb-sdk remote square hide` 会改变审核、发布或用户侧可见状态。交互式终端会展示小程序 id、名称、当前状态、目标版本和操作,再要求确认;非 TTY 环境必须传 `--yes`。
238
257
 
239
258
  所有 `hb-sdk remote` 子命令都支持 `--json`。开启后 stdout 只输出一个 JSON 对象;进度、警告、版本提醒和 verbose 诊断不能污染 stdout。
240
259
 
241
260
  Agent rules:
242
261
 
243
262
  - Use `hb-sdk remote entity list/current/switch` for developer entity inspection and switching.
244
- - Use `hb-sdk remote create --name <name>` for create-and-bind and `hb-sdk remote bind <mini-program-id>` for binding an existing manageable remote mini-program.
263
+ - Use `hb-sdk remote create` for create-and-bind and `hb-sdk remote bind <mini-program-id>` for binding an existing manageable remote mini-program.
264
+ - Keep mini-program name, icon, and cover images in `package.json.heybox.miniProgramProfile`; these fields are submitted with version audit.
245
265
  - Explain that `remote create` creates under the current entity and that multi-entity non-TTY usage must confirm with `--yes`; `--yes` confirms current-entity usage but does not switch entities.
246
266
  - Explain that `remote bind` verifies the mini-program is manageable by the current entity and does not write `package.json.heybox.miniProgramId` on entity mismatch.
247
- - Use `hb-sdk remote info`, `hb-sdk remote update`, `hb-sdk remote access`, `hb-sdk remote list`, `hb-sdk remote versions`, `hb-sdk remote preview <version>`, and `hb-sdk remote allowlist ...` instead of sending users to Open when a matching CLI command exists.
267
+ - Use `hb-sdk remote info`, `hb-sdk remote access`, `hb-sdk remote list`, `hb-sdk remote versions`, `hb-sdk remote preview <version>`, `hb-sdk remote square show/hide`, and `hb-sdk remote allowlist ...` instead of sending users to Open when a matching CLI command exists.
268
+ - Do not expose a CLI basic-info update command; mini-program name and image changes must go through version audit.
248
269
  - Treat `hb-sdk remote list` as discovery only. Dangerous write commands still target the bound mini-program from `package.json.heybox.miniProgramId`.
249
- - Require confirmation or `--yes` for `hb-sdk remote release`, `hb-sdk remote withdraw`, `hb-sdk remote take-down`, and `hb-sdk remote reopen`.
270
+ - Require confirmation or `--yes` for `hb-sdk remote release`, `hb-sdk remote withdraw`, `hb-sdk remote take-down`, `hb-sdk remote reopen`, and `hb-sdk remote square hide`.
250
271
  - Use `--json` for script consumption and keep stdout as exactly one JSON object.
251
272
 
252
273
  ## CLI login cache
@@ -357,7 +378,7 @@ npm run deploy
357
378
 
358
379
  - `npm run dev`:启动本地 Vite 服务和 `hb-sdk` 内置 mock runtime host,适合本地调试 SDK 能力;调试页内可点击按钮在 Mac 版 APP 中启动同一页面,也可以选择局域网网卡后用手机小黑盒 APP 扫码调试。手机需要与电脑处在同一局域网,并使用支持小程序调试壳的新版小黑盒 APP。Codex、VSCode 等内嵌浏览器可能无法唤起系统 APP,需要时请在系统浏览器中打开同一个调试页后重试。
359
380
  - `npm run build`:先执行 TypeScript 检查,再构建生产产物。
360
- - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create --name "..."` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
381
+ - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。小程序名称、icon 和介绍图在 `package.json.heybox.miniProgramProfile` 中配置并随版本审核提交。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
361
382
 
362
383
  ## 更多能力
363
384
 
@@ -218,10 +218,9 @@ hb-sdk remote entity list
218
218
  hb-sdk remote entity current
219
219
  hb-sdk remote entity switch <entity-id>
220
220
  hb-sdk remote list [--status <status>] [--keyword <text>]
221
- hb-sdk remote create --name <name> [--preview-image-url <url>] [--yes] [--force-bind]
221
+ hb-sdk remote create [--yes] [--force-bind]
222
222
  hb-sdk remote bind <mini-program-id> [--force]
223
223
  hb-sdk remote info
224
- hb-sdk remote update [--name <name>] [--preview-image-url <url>]
225
224
  hb-sdk remote allowlist list
226
225
  hb-sdk remote allowlist add <heybox-id...>
227
226
  hb-sdk remote allowlist remove <heybox-id...>
@@ -233,6 +232,8 @@ hb-sdk remote release <version> [--yes]
233
232
  hb-sdk remote withdraw <version> [--yes] [--reason <text>]
234
233
  hb-sdk remote take-down [--yes]
235
234
  hb-sdk remote reopen [--yes]
235
+ hb-sdk remote square hide [--yes]
236
+ hb-sdk remote square show
236
237
 
237
238
  Removed: hb-sdk deploy`;
238
239
 
@@ -401,7 +402,7 @@ ${cliRemoteEntitySection}
401
402
 
402
403
  Agent rules:
403
404
 
404
- - Treat the server-side current entity as the authority for remote create, bind, deploy, list, access, versions, preview, release, withdraw, take-down, and reopen workflows.
405
+ - Treat the server-side current entity as the authority for remote create, bind, deploy, list, access, versions, preview, release, withdraw, take-down, reopen, and square-display workflows.
405
406
  - Treat CLI \`selectedEntity\` as a display/debug snapshot only; it can drift from the server-side current entity and must not be used as a permission source.
406
407
  - Use \`hb-sdk remote entity current\` when a user needs to confirm which entity create/deploy will use.
407
408
  - Use \`hb-sdk remote entity switch <entity-id>\` to change entity scope. Do not recommend \`--entity-id\` or an environment variable as a remote command override.
@@ -414,12 +415,14 @@ ${cliRemoteSection}
414
415
  Agent rules:
415
416
 
416
417
  - Use \`hb-sdk remote entity list/current/switch\` for developer entity inspection and switching.
417
- - Use \`hb-sdk remote create --name <name>\` for create-and-bind and \`hb-sdk remote bind <mini-program-id>\` for binding an existing manageable remote mini-program.
418
+ - Use \`hb-sdk remote create\` for create-and-bind and \`hb-sdk remote bind <mini-program-id>\` for binding an existing manageable remote mini-program.
419
+ - Keep mini-program name, icon, and cover images in \`package.json.heybox.miniProgramProfile\`; these fields are submitted with version audit.
418
420
  - Explain that \`remote create\` creates under the current entity and that multi-entity non-TTY usage must confirm with \`--yes\`; \`--yes\` confirms current-entity usage but does not switch entities.
419
421
  - Explain that \`remote bind\` verifies the mini-program is manageable by the current entity and does not write \`package.json.heybox.miniProgramId\` on entity mismatch.
420
- - Use \`hb-sdk remote info\`, \`hb-sdk remote update\`, \`hb-sdk remote access\`, \`hb-sdk remote list\`, \`hb-sdk remote versions\`, \`hb-sdk remote preview <version>\`, and \`hb-sdk remote allowlist ...\` instead of sending users to Open when a matching CLI command exists.
422
+ - Use \`hb-sdk remote info\`, \`hb-sdk remote access\`, \`hb-sdk remote list\`, \`hb-sdk remote versions\`, \`hb-sdk remote preview <version>\`, \`hb-sdk remote square show/hide\`, and \`hb-sdk remote allowlist ...\` instead of sending users to Open when a matching CLI command exists.
423
+ - Do not expose a CLI basic-info update command; mini-program name and image changes must go through version audit.
421
424
  - Treat \`hb-sdk remote list\` as discovery only. Dangerous write commands still target the bound mini-program from \`package.json.heybox.miniProgramId\`.
422
- - Require confirmation or \`--yes\` for \`hb-sdk remote release\`, \`hb-sdk remote withdraw\`, \`hb-sdk remote take-down\`, and \`hb-sdk remote reopen\`.
425
+ - Require confirmation or \`--yes\` for \`hb-sdk remote release\`, \`hb-sdk remote withdraw\`, \`hb-sdk remote take-down\`, \`hb-sdk remote reopen\`, and \`hb-sdk remote square hide\`.
423
426
  - Use \`--json\` for script consumption and keep stdout as exactly one JSON object.
424
427
 
425
428
  ## CLI login cache
package/skill/skill.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "hb-sdk",
3
- "skillVersion": "0.5.5+skill.0d0c16cf3747",
3
+ "skillVersion": "0.5.7+skill.90b5f340fde8",
4
4
  "sdk": {
5
5
  "package": "@heybox/hb-sdk",
6
- "version": "0.5.5",
7
- "compatibility": "0.5.5"
6
+ "version": "0.5.7",
7
+ "compatibility": "0.5.7"
8
8
  },
9
9
  "source": "https://open.xiaoheihe.cn/agent-skills/hb-sdk",
10
- "integrity": "sha256-0d0c16cf374723b36892f32dae70ea0f8a50a0f44aa507691f8e9a75d6c43fb6"
10
+ "integrity": "sha256-90b5f340fde847a24ce8fe26b6f2134999c19deb0ac0585a431149ca97aa117b"
11
11
  }
@@ -7,7 +7,6 @@ export declare const DEVELOPER_ENTITY_LIST_API_PATH = "/mall/developer/entity/li
7
7
  export declare const DEVELOPER_ENTITY_SWITCH_API_PATH = "/mall/developer/entity/switch";
8
8
  export declare const LIST_USER_MINIPROGRAM_API_PATH = "/mall/developer/user_miniprogram/list";
9
9
  export declare const CREATE_USER_MINIPROGRAM_API_PATH = "/mall/developer/user_miniprogram/create";
10
- export declare const UPDATE_USER_MINIPROGRAM_API_PATH = "/mall/developer/user_miniprogram/update";
11
10
  export declare const DETAIL_USER_MINIPROGRAM_API_PATH = "/mall/developer/user_miniprogram/detail";
12
11
  export declare const USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = "/mall/developer/user_miniprogram/preview_allowlist";
13
12
  export declare const UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH = "/mall/developer/user_miniprogram/preview_allowlist/update";
@@ -18,6 +17,7 @@ export declare const WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH = "/mall/develop
18
17
  export declare const RELEASE_USER_MINIPROGRAM_VERSION_API_PATH = "/mall/developer/user_miniprogram/version/release";
19
18
  export declare const TAKE_DOWN_USER_MINIPROGRAM_API_PATH = "/mall/developer/user_miniprogram/take_down";
20
19
  export declare const REOPEN_USER_MINIPROGRAM_API_PATH = "/mall/developer/user_miniprogram/reopen";
20
+ export declare const UPDATE_SQUARE_DISPLAY_API_PATH = "/mall/developer/user_miniprogram/square_display/update";
21
21
  export declare const LIST_USER_MINIPROGRAM_VERSION_API_PATH = "/mall/developer/user_miniprogram/version/list";
22
22
  export { isValidMiniappManifestVersion as isValidVersion } from '../miniapp-manifest/schema';
23
23
  export declare function normalizeRelativePath(relativePath: string): string;