@heybox/hb-sdk 0.7.0-alpha.2 → 0.7.0-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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0-alpha.3
4
+
5
+ ### SDK
6
+
7
+ - 收紧生产开发地址确认边界.
8
+ - 统一小程序宿主运行时安全策略.
9
+
10
+ ### Runtime
11
+
12
+ - 导出 URL 判定工具并接线截图 chrome 隐藏 (@heybox/hb-sdk-runtime).
13
+ - 收口用户授权编排到 Runtime adapter (@heybox/hb-sdk-runtime).
14
+ - 切断 legacy 依赖并收口 Host Runtime 边界 (@heybox/hb-sdk-runtime).
15
+ - 收口生产启动解析与请求装配 (@heybox/hb-sdk-runtime).
16
+ - 补强生产启动配置矩阵 (@heybox/hb-sdk-runtime).
17
+ - 统一生产入口到 Core Runtime (@heybox/hb-sdk-runtime).
18
+ - 增加 Runtime-first 生产 Host 入口 (@heybox/hb-sdk-runtime).
19
+ - 严格校验平台适配器输入 (@heybox/hb-sdk-runtime).
20
+ - 移除能力目录重复枚举 (@heybox/hb-sdk-runtime).
21
+ - 统一 Host 核心状态机与协议实现 (@heybox/hb-sdk-runtime).
22
+ - 完善生产启动矩阵契约 (@heybox/hb-sdk-runtime).
23
+ - 补充 Host URL 脱敏契约 (@heybox/hb-sdk-runtime).
24
+ - 补强 Host 迁移安全契约 (@heybox/hb-sdk-runtime).
25
+ - 固化生产 Host 迁移契约 (@heybox/hb-sdk-runtime).
26
+
3
27
  ## 0.7.0-alpha.2
4
28
 
5
29
  ### CLI
@@ -5,8 +5,8 @@ var fs = require('node:fs/promises');
5
5
  var path = require('node:path');
6
6
  var runtimePermissionEnv = require('./runtime-permission-env-D-8_jPG3.cjs');
7
7
  var runtimeGate = require('./runtime-gate-CtV7rWyX.cjs');
8
- var index = require('./index-BnBeTd0B.cjs');
9
- var projectVite = require('./project-vite-CgnCpNDZ.cjs');
8
+ var index = require('./index-DRee9Dhy.cjs');
9
+ var projectVite = require('./project-vite-DwhS4B4Z.cjs');
10
10
  require('node:async_hooks');
11
11
  require('node:module');
12
12
  require('path');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var session = require('./session-Davw2CMd.cjs');
3
+ var session = require('./session-Bem7bONz.cjs');
4
4
  var runtimePermissionEnv = require('./runtime-permission-env-D-8_jPG3.cjs');
5
5
  var fs$1 = require('node:fs');
6
6
  var fs = require('node:fs/promises');
@@ -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-BnBeTd0B.cjs');
8
+ var index = require('./index-DRee9Dhy.cjs');
9
9
  require('node:module');
10
10
  require('os');
11
11
  require('readline');
@@ -6,15 +6,15 @@ var path = require('node:path');
6
6
  var net = require('node:net');
7
7
  var promises = require('node:dns/promises');
8
8
  var node_http = require('node:http');
9
- var context = require('./context-Bl_Q4RKq.cjs');
9
+ var context = require('./context-Bx4aT-NN.cjs');
10
10
  var node_crypto = require('node:crypto');
11
11
  var undici = require('undici');
12
12
  var browser = require('./browser-RAy8e8cV.cjs');
13
- var index = require('./index-BnBeTd0B.cjs');
14
- var projectVite = require('./project-vite-CgnCpNDZ.cjs');
13
+ var index = require('./index-DRee9Dhy.cjs');
14
+ var projectVite = require('./project-vite-DwhS4B4Z.cjs');
15
15
  var fs$1 = require('node:fs/promises');
16
16
  var runtimePermissionEnv = require('./runtime-permission-env-D-8_jPG3.cjs');
17
- require('./session-Davw2CMd.cjs');
17
+ require('./session-Bem7bONz.cjs');
18
18
  require('fs');
19
19
  require('constants');
20
20
  require('stream');
@@ -1347,7 +1347,7 @@ function createHeyboxProtocol(payload) {
1347
1347
  /** 构建时替换为当前发布包的实际版本。 */
1348
1348
  const HB_SDK_VERSION = typeof undefined === 'string'
1349
1349
  ? undefined
1350
- : '0.7.0-alpha.2';
1350
+ : '0.7.0-alpha.3';
1351
1351
 
1352
1352
  class DevPermissionOverrideStoreError extends Error {
1353
1353
  code;
@@ -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-BnBeTd0B.cjs');
7
+ var index = require('./index-DRee9Dhy.cjs');
8
8
  require('node:module');
9
9
  require('path');
10
10
  require('os');
@@ -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-BnBeTd0B.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-DRee9Dhy.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-BnBeTd0B.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-DRee9Dhy.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-BnBeTd0B.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-DRee9Dhy.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-BnBeTd0B.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-DRee9Dhy.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-BnBeTd0B.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-DRee9Dhy.cjs', document.baseURI).href)));
250
250
  function __require() { return require$1("node:process"); }
251
251
 
252
252
  var help = {};
@@ -13347,7 +13347,7 @@ function getPathname(pathWithQuery) {
13347
13347
  }
13348
13348
 
13349
13349
  const CLI_VERSION_PLACEHOLDER = ['__HB', 'SDK', 'CLI', 'VERSION__'].join('_');
13350
- const BUILT_CLI_VERSION = '0.7.0-alpha.2';
13350
+ const BUILT_CLI_VERSION = '0.7.0-alpha.3';
13351
13351
  const PACKAGE_JSON_CANDIDATES = [
13352
13352
  path.resolve(__dirname, '..', '..', 'package.json'),
13353
13353
  path.resolve(__dirname, '..', 'package.json'),
@@ -13681,35 +13681,35 @@ function createCommandLoggerResolver(options) {
13681
13681
  };
13682
13682
  }
13683
13683
  const defaultClearLoginStatus = async (...args) => {
13684
- const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-DnX81kof.cjs'); });
13684
+ const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-C6Pgq394.cjs'); });
13685
13685
  return clearLoginStatus(...args);
13686
13686
  };
13687
13687
  const defaultLoginToHeybox = async (...args) => {
13688
- const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-DnX81kof.cjs'); });
13688
+ const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-C6Pgq394.cjs'); });
13689
13689
  return loginToHeybox(...args);
13690
13690
  };
13691
13691
  const defaultPrintLoginStatus = async (...args) => {
13692
- const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-DnX81kof.cjs'); });
13692
+ const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-C6Pgq394.cjs'); });
13693
13693
  return printLoginStatus(...args);
13694
13694
  };
13695
13695
  const defaultRunBuildCommand = async (...args) => {
13696
- const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-DLIhlBQA.cjs'); });
13696
+ const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-DTU4TgMT.cjs'); });
13697
13697
  return runBuildCommand(...args);
13698
13698
  };
13699
13699
  const defaultRunCreateCommand = async (...args) => {
13700
- const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-C--pwY0l.cjs'); });
13700
+ const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-D9Nls0P8.cjs'); });
13701
13701
  return runCreateCommand(...args);
13702
13702
  };
13703
13703
  const defaultRunDevCommand = async (...args) => {
13704
- const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-B1tyT5ql.cjs'); });
13704
+ const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-DKrRVtVi.cjs'); });
13705
13705
  return runDevCommand(...args);
13706
13706
  };
13707
13707
  const defaultRunDoctorCommand = async (...args) => {
13708
- const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-D9M2scaJ.cjs'); });
13708
+ const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-DM5_TKLh.cjs'); });
13709
13709
  return runDoctorCommand(...args);
13710
13710
  };
13711
13711
  const defaultRunRemoteCommand = async (...args) => {
13712
- const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-CETqg77E.cjs'); });
13712
+ const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-CdH6zSbP.cjs'); });
13713
13713
  return runRemoteCommand(...args);
13714
13714
  };
13715
13715
  function resolveStandaloneLogger(options, verbose) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index$2 = require('./index-BnBeTd0B.cjs');
3
+ var index$2 = require('./index-DRee9Dhy.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');
@@ -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-Davw2CMd.cjs');
6
+ var session = require('./session-Bem7bONz.cjs');
7
7
  var browser = require('./browser-RAy8e8cV.cjs');
8
- var index = require('./index-BnBeTd0B.cjs');
8
+ var index = require('./index-DRee9Dhy.cjs');
9
9
  require('node:path');
10
10
  require('fs');
11
11
  require('constants');
@@ -5,7 +5,7 @@ var fs$1 = require('node:fs/promises');
5
5
  var node_module = require('node:module');
6
6
  var path = require('node:path');
7
7
  var node_url = require('node:url');
8
- var index = require('./index-BnBeTd0B.cjs');
8
+ var index = require('./index-DRee9Dhy.cjs');
9
9
 
10
10
  function findProjectRoot(startDir) {
11
11
  let current = path.resolve(startDir);
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var promises = require('node:readline/promises');
4
- var index = require('./index-BnBeTd0B.cjs');
5
- var session = require('./session-Davw2CMd.cjs');
4
+ var index = require('./index-DRee9Dhy.cjs');
5
+ var session = require('./session-Bem7bONz.cjs');
6
6
  var childProcess = require('node:child_process');
7
7
  var fs = require('node:fs');
8
8
  var fs$1 = require('node:fs/promises');
@@ -10,7 +10,7 @@ var path = require('node:path');
10
10
  var runtimePermissionEnv = require('./runtime-permission-env-D-8_jPG3.cjs');
11
11
  var runtimeGate = require('./runtime-gate-CtV7rWyX.cjs');
12
12
  var node_crypto = require('node:crypto');
13
- var context = require('./context-Bl_Q4RKq.cjs');
13
+ var context = require('./context-Bx4aT-NN.cjs');
14
14
  require('node:module');
15
15
  require('path');
16
16
  require('os');
@@ -271,7 +271,7 @@ function createDefaultCosClient(uploadToken, COS) {
271
271
  };
272
272
  }
273
273
  async function loadCosConstructor() {
274
- const cosModule = await Promise.resolve().then(function () { return require('./index-HNB8i51C.cjs'); }).then(function (n) { return n.index; });
274
+ const cosModule = await Promise.resolve().then(function () { return require('./index-doiKZGkJ.cjs'); }).then(function (n) { return n.index; });
275
275
  return cosModule.default;
276
276
  }
277
277
  function formatSize(bytes) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BnBeTd0B.cjs');
3
+ var index = require('./index-DRee9Dhy.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-BnBeTd0B.cjs');
3
+ var index = require('./cli-chunks/index-DRee9Dhy.cjs');
4
4
  require('node:module');
5
5
  require('node:fs');
6
6
  require('node:fs/promises');
@@ -5081,9 +5081,9 @@ function isShareChannel(value) {
5081
5081
  }
5082
5082
 
5083
5083
  /** 获取小程序隔离 storage。 */
5084
- function getMiniProgramRuntimeStorage(payload, options, platformAdapter) {
5084
+ async function getMiniProgramRuntimeStorage(payload, options, platformAdapter) {
5085
5085
  const { key } = readMiniProgramGetStoragePayload(payload, options.maxKeyLength);
5086
- const storageValue = platformAdapter.storage.getStorage({
5086
+ const storageValue = await platformAdapter.storage.getStorage({
5087
5087
  key: createMiniProgramRuntimeStorageKey(key, options.scope || getMiniProgramRuntimeStorageScope(undefined, platformAdapter), options.maxKeyLength),
5088
5088
  });
5089
5089
  return {
@@ -5194,6 +5194,10 @@ async function getMiniProgramRuntimeLocalIdentity(payload, platformAdapter, iden
5194
5194
  || !result.appUserId.trim()) {
5195
5195
  throw createMiniProgramRuntimeBridgeError('INVALID_RESPONSE', 'Host user.getLocalIdentity 返回无效');
5196
5196
  }
5197
+ platformAdapter.auth.emitAuthEvent?.('user_info_authorization_change', {
5198
+ identity: 'granted',
5199
+ profile: 'not_requested',
5200
+ });
5197
5201
  return { appUserId: result.appUserId };
5198
5202
  }
5199
5203
 
@@ -5209,6 +5213,10 @@ async function revokeMiniProgramRuntimeAuthorization(payload, platformAdapter, i
5209
5213
  miniProgramId,
5210
5214
  trustedUserGesture: Boolean(await platformAdapter.auth.hasTrustedUserGesture?.()),
5211
5215
  });
5216
+ platformAdapter.auth.emitAuthEvent?.('user_info_authorization_change', {
5217
+ identity: 'denied',
5218
+ profile: 'denied',
5219
+ });
5212
5220
  }
5213
5221
 
5214
5222
  const DEFAULT_LIMIT = 20;
@@ -5858,7 +5866,7 @@ class MiniProgramMockRuntime {
5858
5866
  async setNavigationBarStyle(payload) {
5859
5867
  await setMiniProgramRuntimeNavigationBarStyle(payload, this.adapter);
5860
5868
  }
5861
- getStorage(payload) {
5869
+ async getStorage(payload) {
5862
5870
  return getMiniProgramRuntimeStorage(payload, this.options.storage || {}, this.adapter);
5863
5871
  }
5864
5872
  async setStorage(payload) {
package/dist/index.cjs.js CHANGED
@@ -603,7 +603,7 @@ function createMessageId() {
603
603
  /** 构建时替换为当前发布包的实际版本。 */
604
604
  const HB_SDK_VERSION = typeof undefined === 'string'
605
605
  ? undefined
606
- : '0.7.0-alpha.2';
606
+ : '0.7.0-alpha.3';
607
607
 
608
608
  /**
609
609
  * 判断未知数据是否符合小程序 bridge 消息信封。
package/dist/index.esm.js CHANGED
@@ -599,7 +599,7 @@ function createMessageId() {
599
599
  /** 构建时替换为当前发布包的实际版本。 */
600
600
  const HB_SDK_VERSION = typeof undefined === 'string'
601
601
  ? undefined
602
- : '0.7.0-alpha.2';
602
+ : '0.7.0-alpha.3';
603
603
 
604
604
  /**
605
605
  * 判断未知数据是否符合小程序 bridge 消息信封。
package/dist/vite.cjs.js CHANGED
@@ -8,7 +8,7 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
8
8
  /** 构建时替换为当前发布包的实际版本。 */
9
9
  const HB_SDK_VERSION = typeof undefined === 'string'
10
10
  ? undefined
11
- : '0.7.0-alpha.2';
11
+ : '0.7.0-alpha.3';
12
12
 
13
13
  var re = {exports: {}};
14
14
 
package/dist/vite.esm.js CHANGED
@@ -5,7 +5,7 @@ import { AsyncLocalStorage } from 'node:async_hooks';
5
5
  /** 构建时替换为当前发布包的实际版本。 */
6
6
  const HB_SDK_VERSION = typeof undefined === 'string'
7
7
  ? undefined
8
- : '0.7.0-alpha.2';
8
+ : '0.7.0-alpha.3';
9
9
 
10
10
  var re = {exports: {}};
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heybox/hb-sdk",
3
- "version": "0.7.0-alpha.2",
3
+ "version": "0.7.0-alpha.3",
4
4
  "sideEffects": [
5
5
  "./src/index.ts",
6
6
  "./src/core/singleton.ts",
@@ -95,7 +95,7 @@
95
95
  "vue": "^2.7.16",
96
96
  "vite": "^8.0.12",
97
97
  "vitest": "^3.2.4",
98
- "@heybox/hb-api": "~1.25.16"
98
+ "@heybox/hb-api": "~1.25.17"
99
99
  },
100
100
  "publishConfig": {
101
101
  "registry": "https://registry.npmjs.org/",