@heybox/hb-sdk 0.7.1 → 0.7.2-alpha.0
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 +1 -1
- package/dist/cli-chunks/{build-i36rHC8w.cjs → build-DbQt0LIs.cjs} +2 -2
- package/dist/cli-chunks/{context-DmtAhQC7.cjs → context-Cmrhge3Y.cjs} +2 -2
- package/dist/cli-chunks/{create-D5bC0jY_.cjs → create-5ZLxb2p_.cjs} +1 -1
- package/dist/cli-chunks/{dev-CKPzEVZs.cjs → dev-CWSJ0YIw.cjs} +5 -5
- package/dist/cli-chunks/{doctor-CPdodzWY.cjs → doctor-CpFYiqK9.cjs} +1 -1
- package/dist/cli-chunks/{index-BYXJJ0O2.cjs → index-BV8DdyEP.cjs} +14 -14
- package/dist/cli-chunks/{index-Dyim0XNM.cjs → index-DomfJMuO.cjs} +1 -1
- package/dist/cli-chunks/{login-Da9gejmw.cjs → login-DhD2o29N.cjs} +2 -2
- package/dist/cli-chunks/{project-vite-DgIxZGf7.cjs → project-vite-8IkVMyPu.cjs} +1 -1
- package/dist/cli-chunks/{remote-iftAjHWt.cjs → remote-BZ6rfyuZ.cjs} +4 -4
- package/dist/cli-chunks/{session-Y0Eur0YE.cjs → session-DnqyIY87.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.esm.js +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/api-root.md +2 -2
- package/skill/references/cli.md +2 -2
- package/skill/references/safety-boundaries.md +1 -1
- package/skill/skill.json +4 -4
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ SDK 还提供 `getHandshakeState()` / `onHandshakeStateChange()` 管理持久握
|
|
|
134
134
|
- 业务网络请求使用 `network.request()`,不要依赖浏览器原生网络出口。
|
|
135
135
|
- `network.request()` 不能访问平台保留的 runtime auth 与 OpenAPI 内部路径;页面不得持有或交换服务端应用凭据。
|
|
136
136
|
- `network.request` 不支持 `multipart/form-data`;App Host 仅支持 form(`application/x-www-form-urlencoded`)与 JSON。表单请用 `URLSearchParams#toString()` 作为 `data`,文件上传请走专用上传能力。
|
|
137
|
-
- 仅当远端已启用 `network.request`
|
|
137
|
+
- 仅当远端已启用 `network.request` 时,`hb-sdk dev` 与 `hb-sdk remote deploy` 构建才会跳过平台 CSP;其他构建继续注入平台 CSP。`useOfficialDomain` 不参与 CSP 跳过判定。
|
|
138
138
|
- 构建必须启用 `miniappManifest()`,推荐统一使用 `hb-sdk build`。
|
|
139
139
|
|
|
140
140
|
## 云端排行榜
|
|
@@ -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-
|
|
9
|
-
var projectVite = require('./project-vite-
|
|
8
|
+
var index = require('./index-BV8DdyEP.cjs');
|
|
9
|
+
var projectVite = require('./project-vite-8IkVMyPu.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-
|
|
3
|
+
var session = require('./session-DnqyIY87.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');
|
|
@@ -61,7 +61,7 @@ function isRecord(value) {
|
|
|
61
61
|
function shouldSkipMiniappPlatformCsp(runtimePermissions) {
|
|
62
62
|
const parsed = parseMiniProgramRuntimePermissions(runtimePermissions);
|
|
63
63
|
const networkRequest = parsed.permissions['network.request'];
|
|
64
|
-
return parsed.valid && networkRequest?.status === 'enabled'
|
|
64
|
+
return parsed.valid && networkRequest?.status === 'enabled';
|
|
65
65
|
}
|
|
66
66
|
const DEFAULT_PERMISSION_STATE = {
|
|
67
67
|
networkRequest: {
|
|
@@ -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-
|
|
8
|
+
var index = require('./index-BV8DdyEP.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-
|
|
9
|
+
var context = require('./context-Cmrhge3Y.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-
|
|
14
|
-
var projectVite = require('./project-vite-
|
|
13
|
+
var index = require('./index-BV8DdyEP.cjs');
|
|
14
|
+
var projectVite = require('./project-vite-8IkVMyPu.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-
|
|
17
|
+
require('./session-DnqyIY87.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.
|
|
1350
|
+
: '0.7.2-alpha.0';
|
|
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-
|
|
7
|
+
var index = require('./index-BV8DdyEP.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-
|
|
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-BV8DdyEP.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-
|
|
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-BV8DdyEP.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-
|
|
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-BV8DdyEP.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-
|
|
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-BV8DdyEP.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-
|
|
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-BV8DdyEP.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.
|
|
13350
|
+
const BUILT_CLI_VERSION = '0.7.2-alpha.0';
|
|
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-
|
|
13684
|
+
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-DhD2o29N.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-
|
|
13688
|
+
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-DhD2o29N.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-
|
|
13692
|
+
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-DhD2o29N.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-
|
|
13696
|
+
const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-DbQt0LIs.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-
|
|
13700
|
+
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-5ZLxb2p_.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-
|
|
13704
|
+
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-CWSJ0YIw.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-
|
|
13708
|
+
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-CpFYiqK9.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-
|
|
13712
|
+
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-BZ6rfyuZ.cjs'); });
|
|
13713
13713
|
return runRemoteCommand(...args);
|
|
13714
13714
|
};
|
|
13715
13715
|
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-
|
|
6
|
+
var session = require('./session-DnqyIY87.cjs');
|
|
7
7
|
var browser = require('./browser-RAy8e8cV.cjs');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-BV8DdyEP.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-
|
|
8
|
+
var index = require('./index-BV8DdyEP.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-
|
|
5
|
-
var session = require('./session-
|
|
4
|
+
var index = require('./index-BV8DdyEP.cjs');
|
|
5
|
+
var session = require('./session-DnqyIY87.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-
|
|
13
|
+
var context = require('./context-Cmrhge3Y.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-
|
|
274
|
+
const cosModule = await Promise.resolve().then(function () { return require('./index-DomfJMuO.cjs'); }).then(function (n) { return n.index; });
|
|
275
275
|
return cosModule.default;
|
|
276
276
|
}
|
|
277
277
|
function formatSize(bytes) {
|
package/dist/cli.cjs
CHANGED
package/dist/index.cjs.js
CHANGED
package/dist/index.esm.js
CHANGED
package/dist/vite.cjs.js
CHANGED
package/dist/vite.esm.js
CHANGED
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -65,7 +65,7 @@ Apply these instructions when writing, reviewing, or debugging code that consume
|
|
|
65
65
|
10. Use `hb-sdk remote create` to create and bind a mini-program; use `hb-sdk remote bind <mini-program-id>` to bind an existing manageable mini-program.
|
|
66
66
|
11. 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 remote inspection and preview management.
|
|
67
67
|
12. Use `hb-sdk remote deploy --release-note <text>` to run the project's `scripts.build`, upload, and submit the current project for audit. Do not recommend the removed top-level `hb-sdk deploy` alias.
|
|
68
|
-
13. `hb-sdk dev` and `hb-sdk remote deploy` skip the platform CSP only when the validated remote permission snapshot has `network.request.status=enabled
|
|
68
|
+
13. `hb-sdk dev` and `hb-sdk remote deploy` skip the platform CSP only when the validated remote permission snapshot has `network.request.status=enabled`. `useOfficialDomain` does not participate in CSP skip decisions. Direct `hb-sdk build`, direct Vite build, anonymous or invalid snapshots, and local Dev Context overrides must keep the platform CSP. Runtime Gate, Manifest, and HTML validation always remain active.
|
|
69
69
|
14. After approval, use `hb-sdk remote release <version>` for manual release or `--auto-publish` when an eligible low-risk version should release automatically.
|
|
70
70
|
15. Treat approval, release, and public display as separate states. Do not promise square, search, or recommendation visibility after release.
|
|
71
71
|
16. Use `hb-sdk remote withdraw`, `hb-sdk remote take-down`, `hb-sdk remote reopen`, and square visibility commands only after showing the target and obtaining required confirmation.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
## Package metadata
|
|
25
25
|
|
|
26
26
|
- Package: `@heybox/hb-sdk`
|
|
27
|
-
- Version at generation time: `0.7.0`
|
|
27
|
+
- Version at generation time: `0.7.2-alpha.0`
|
|
28
28
|
- Public root export: `@heybox/hb-sdk`
|
|
29
29
|
- Protocol export: `@heybox/hb-sdk/protocol`
|
|
30
30
|
- Vite plugin export: `@heybox/hb-sdk/vite`
|
|
@@ -373,7 +373,7 @@ hb-sdk build [--env <name>] [--verbose]
|
|
|
373
373
|
|
|
374
374
|
`hb-sdk build` 直接使用项目安装的 Vite,先清理再生成固定的 `dist/`,并校验小程序入口、Manifest 和可上传产物。它不执行类型检查,不要求 CLI 登录或绑定小程序,也不访问远端服务。项目必须在 `vite.config.ts` 中显式注册 `miniappManifest()`。
|
|
375
375
|
|
|
376
|
-
直接运行 `hb-sdk build` 或 `vite build` 时默认注入平台 CSP。`hb-sdk remote deploy` 会在构建前读取绑定小程序的远端权限;仅当 `network.request.status=enabled`
|
|
376
|
+
直接运行 `hb-sdk build` 或 `vite build` 时默认注入平台 CSP。`hb-sdk remote deploy` 会在构建前读取绑定小程序的远端权限;仅当 `network.request.status=enabled` 时向子构建传递已验证上下文并跳过平台 CSP,`useOfficialDomain` 不参与该判定。权限缺失、非法或读取失败时继续注入,Runtime Gate、Manifest 与 HTML 构建检查始终保留。
|
|
377
377
|
|
|
378
378
|
推荐由项目的 `scripts.build` 保留类型检查:
|
|
379
379
|
|
package/skill/references/cli.md
CHANGED
|
@@ -106,7 +106,7 @@ CLI 会启动页面服务并自动打开本地调试页。调试页会展示小
|
|
|
106
106
|
|
|
107
107
|
未登录或未绑定小程序时,浏览器、Mac 和手机调试入口仍然可用,但受管能力会默认拒绝。登录并绑定后,调试页才能根据当前小程序的线上配置提示差异。
|
|
108
108
|
|
|
109
|
-
`hb-sdk dev` 会在启动 Vite
|
|
109
|
+
`hb-sdk dev` 会在启动 Vite 前读取远端权限。只有远端权限快照有效且 `network.request.status=enabled` 时才跳过平台 CSP;`useOfficialDomain` 不参与该判定。未登录、未绑定、读取失败、非法快照或仅在 Dev Context 中开启本地权限覆盖时都继续注入 CSP。
|
|
110
110
|
|
|
111
111
|
### 2. 先用浏览器 Mock 验收
|
|
112
112
|
|
|
@@ -155,7 +155,7 @@ hb-sdk build [--env <name>] [--verbose]
|
|
|
155
155
|
|
|
156
156
|
`hb-sdk build` 直接使用项目安装的 Vite,先清理再生成固定的 `dist/`,并校验小程序入口、Manifest 和可上传产物。它不执行类型检查,不要求 CLI 登录或绑定小程序,也不访问远端服务。项目必须在 `vite.config.ts` 中显式注册 `miniappManifest()`。
|
|
157
157
|
|
|
158
|
-
直接运行 `hb-sdk build` 或 `vite build` 时默认注入平台 CSP。`hb-sdk remote deploy` 会在构建前读取绑定小程序的远端权限;仅当 `network.request.status=enabled`
|
|
158
|
+
直接运行 `hb-sdk build` 或 `vite build` 时默认注入平台 CSP。`hb-sdk remote deploy` 会在构建前读取绑定小程序的远端权限;仅当 `network.request.status=enabled` 时向子构建传递已验证上下文并跳过平台 CSP,`useOfficialDomain` 不参与该判定。权限缺失、非法或读取失败时继续注入,Runtime Gate、Manifest 与 HTML 构建检查始终保留。
|
|
159
159
|
|
|
160
160
|
推荐由项目的 `scripts.build` 保留类型检查:
|
|
161
161
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
- 业务网络请求使用 `network.request()`,不要依赖浏览器原生网络出口。
|
|
24
24
|
- `network.request()` 不能访问平台保留的 runtime auth 与 OpenAPI 内部路径;页面不得持有或交换服务端应用凭据。
|
|
25
25
|
- `network.request` 不支持 `multipart/form-data`;App Host 仅支持 form(`application/x-www-form-urlencoded`)与 JSON。表单请用 `URLSearchParams#toString()` 作为 `data`,文件上传请走专用上传能力。
|
|
26
|
-
- 仅当远端已启用 `network.request`
|
|
26
|
+
- 仅当远端已启用 `network.request` 时,`hb-sdk dev` 与 `hb-sdk remote deploy` 构建才会跳过平台 CSP;其他构建继续注入平台 CSP。`useOfficialDomain` 不参与 CSP 跳过判定。
|
|
27
27
|
- 构建必须启用 `miniappManifest()`,推荐统一使用 `hb-sdk build`。
|
|
28
28
|
|
|
29
29
|
## Agent rules
|
package/skill/skill.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.7.0+skill.
|
|
3
|
+
"skillVersion": "0.7.2-alpha.0+skill.7e88bbacd2f0",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.7.0",
|
|
7
|
-
"compatibility": "0.7.0"
|
|
6
|
+
"version": "0.7.2-alpha.0",
|
|
7
|
+
"compatibility": "0.7.2-alpha.0"
|
|
8
8
|
},
|
|
9
9
|
"source": "https://open.xiaoheihe.cn/agent-skills/hb-sdk",
|
|
10
|
-
"integrity": "sha256-
|
|
10
|
+
"integrity": "sha256-7e88bbacd2f08a16978980c7bb9e27e5d9be8db3c2907f086743a1c6b61463d9"
|
|
11
11
|
}
|