@heybox/hb-sdk 0.9.9-alpha.1 → 0.9.9-alpha.12
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 +38 -0
- package/dist/cli-chunks/{build-vZ5iT2JO.cjs → build-B3VyxfKr.cjs} +4 -4
- package/dist/cli-chunks/{create-DJseFABS.cjs → create-39LGd3Va.cjs} +1 -1
- package/dist/cli-chunks/{dev-CsuAVpLX.cjs → dev-B3gKz4BL.cjs} +16785 -15512
- package/dist/cli-chunks/{doctor-BYzYg-oP.cjs → doctor-BE6I4-rx.cjs} +1 -1
- package/dist/cli-chunks/{game-binding-guide-BfKQ4e83.cjs → game-binding-guide-DDa7jfSf.cjs} +2 -2
- package/dist/cli-chunks/{game-bindings-DWOIBCax.cjs → game-bindings-Btsa9s9U.cjs} +3 -3
- package/dist/cli-chunks/{games-DmPaqaDd.cjs → games-Dgs1h1U5.cjs} +1 -1
- package/dist/cli-chunks/{index-DPEhBPfc.cjs → index-BGtIgSyr.cjs} +1 -1
- package/dist/cli-chunks/{index-D5rcGk_z.cjs → index-DdaTdCPN.cjs} +489 -23
- package/dist/cli-chunks/{index.esm-DYWovNyE.cjs → index.esm-_pGbNbXF.cjs} +11 -11
- package/dist/cli-chunks/{login-o1LQxi8P.cjs → login-Bal-XkCR.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-CGIy1XaL.cjs → project-vite-BBF1D8Bo.cjs} +1 -1
- package/dist/cli-chunks/{remote-BQ3O-aiB.cjs → remote-pyeuWkyG.cjs} +987 -846
- package/dist/cli-chunks/{runtime-permission-env-soFtqTxP.cjs → runtime-permission-env-E7_Ozj6z.cjs} +3 -2
- package/dist/cli-chunks/{skill-BHighcnl.cjs → skill-DQze9VfS.cjs} +2 -2
- package/dist/cli-chunks/{version-CAh_EBAH.cjs → version-CgVSWQYR.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-CRF7uMBi.js +224 -0
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-CRCVNdl9.js +6 -0
- package/dist/devtools/browser-dev-host/assets/index-870cPYsT.css +1 -0
- package/dist/devtools/browser-dev-host/assets/index-CdokjhK8.js +574 -0
- package/dist/devtools/browser-dev-host/assets/pc-onboarding-example-BS3sevnG.webp +0 -0
- package/dist/devtools/browser-dev-host/index.html +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/vite.cjs.js +16 -8
- package/dist/vite.esm.js +16 -8
- package/package.json +5 -4
- package/skill/SKILL.md +7 -0
- package/skill/skill.json +5 -5
- package/types/vite/index.d.ts +2 -0
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-D9CVFRHE.js +0 -224
- package/dist/devtools/browser-dev-host/assets/desktop-app-launch-FZ3iQQs-.js +0 -13
- package/dist/devtools/browser-dev-host/assets/index-CVzVitcL.js +0 -567
- package/dist/devtools/browser-dev-host/assets/index-D0XGMYIr.css +0 -1
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
<meta name="theme-color" content="#f4f5f7" media="(prefers-color-scheme: light)" />
|
|
8
8
|
<meta name="theme-color" content="#14191e" media="(prefers-color-scheme: dark)" />
|
|
9
9
|
<title>小程序工坊调试台</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-app-launch-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-CdokjhK8.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-app-launch-CRCVNdl9.js">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-870cPYsT.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="app"></div>
|
package/dist/index.cjs.js
CHANGED
|
@@ -8146,7 +8146,7 @@ function createMessageId() {
|
|
|
8146
8146
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
8147
8147
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
8148
8148
|
? undefined
|
|
8149
|
-
: '0.9.9-alpha.
|
|
8149
|
+
: '0.9.9-alpha.12';
|
|
8150
8150
|
|
|
8151
8151
|
const RUNTIME_MODES = new Set(['production', 'preview', 'development', 'unknown']);
|
|
8152
8152
|
const OPERATING_SYSTEM_NAMES = new Set(['android', 'ios', 'ohos', 'windows', 'macos', 'linux', 'unknown']);
|
package/dist/index.esm.js
CHANGED
|
@@ -8142,7 +8142,7 @@ function createMessageId() {
|
|
|
8142
8142
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
8143
8143
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
8144
8144
|
? undefined
|
|
8145
|
-
: '0.9.9-alpha.
|
|
8145
|
+
: '0.9.9-alpha.12';
|
|
8146
8146
|
|
|
8147
8147
|
const RUNTIME_MODES = new Set(['production', 'preview', 'development', 'unknown']);
|
|
8148
8148
|
const OPERATING_SYSTEM_NAMES = new Set(['android', 'ios', 'ohos', 'windows', 'macos', 'linux', 'unknown']);
|
package/dist/vite.cjs.js
CHANGED
|
@@ -11293,7 +11293,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
11293
11293
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
11294
11294
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
11295
11295
|
? undefined
|
|
11296
|
-
: '0.9.9-alpha.
|
|
11296
|
+
: '0.9.9-alpha.12';
|
|
11297
11297
|
|
|
11298
11298
|
/**
|
|
11299
11299
|
* network.request 诊断日志的纯脱敏工具。
|
|
@@ -22592,7 +22592,8 @@ const diagnosticsOwner = (diagnosticsOwnerRegistry[diagnosticsOwnerKey] ??= new
|
|
|
22592
22592
|
* @since 0.3.1
|
|
22593
22593
|
*/
|
|
22594
22594
|
function miniappManifest() {
|
|
22595
|
-
const
|
|
22595
|
+
const mobilePreview = process.env.HB_SDK_MOBILE_PREVIEW === '1';
|
|
22596
|
+
const includeCompanions = !mobilePreview && process.env.HB_SDK_SKIP_COMPANIONS !== '1';
|
|
22596
22597
|
const diagnosticsSessionId = process.env.HB_SDK_DEV_DIAGNOSTICS_SESSION_ID;
|
|
22597
22598
|
const managedDiagnostics = diagnosticsSessionId ? getDevDiagnosticsSession(diagnosticsSessionId) : undefined;
|
|
22598
22599
|
if (diagnosticsSessionId && !managedDiagnostics)
|
|
@@ -22632,7 +22633,7 @@ function miniappManifest() {
|
|
|
22632
22633
|
}
|
|
22633
22634
|
return {
|
|
22634
22635
|
...(config.base === undefined ? { base: './' } : {}),
|
|
22635
|
-
...(buildTargets ? { build: { target: buildTargets } } : {}),
|
|
22636
|
+
...(buildTargets ? { build: { target: buildTargets, ...(mobilePreview ? { sourcemap: false, emptyOutDir: true } : {}) } } : {}),
|
|
22636
22637
|
define: {
|
|
22637
22638
|
[sdkVersionBuildConstant]: JSON.stringify(resolveSdkVersion()),
|
|
22638
22639
|
},
|
|
@@ -22998,6 +22999,9 @@ function miniappManifest() {
|
|
|
22998
22999
|
if (isLegacyMobileTemplatePlatforms(platforms))
|
|
22999
23000
|
this.warn(getLegacyMobileTemplatePlatformsNotice());
|
|
23000
23001
|
const parsedPermissions = readMiniappPermissionsFromPackageJson(root, sdkVersion);
|
|
23002
|
+
// 手机构建与其独立签发的开发快照使用相同权限,不携带桌面 Companion。
|
|
23003
|
+
if (mobilePreview && parsedPermissions.permissions)
|
|
23004
|
+
delete parsedPermissions.permissions.companion;
|
|
23001
23005
|
const windowDeclaration = readMiniappWindowFromPackageJson(root);
|
|
23002
23006
|
const companionConfig = readMiniappCompanionsFromPackageJson(root);
|
|
23003
23007
|
const companionDeclarations = includeCompanions ? companionConfig.declarations : undefined;
|
|
@@ -23240,8 +23244,7 @@ function resolveHmrWebSocketUrls(resolved, server) {
|
|
|
23240
23244
|
const urls = [...(server?.resolvedUrls?.local ?? []), ...(server?.resolvedUrls?.network ?? [])];
|
|
23241
23245
|
if (urls.length === 0) {
|
|
23242
23246
|
const configuredHost = resolved.server.host;
|
|
23243
|
-
const host = typeof configuredHost === 'string' && configuredHost !== '0.0.0.0' && configuredHost !== '::'
|
|
23244
|
-
? configuredHost : '127.0.0.1';
|
|
23247
|
+
const host = typeof configuredHost === 'string' && configuredHost !== '0.0.0.0' && configuredHost !== '::' ? configuredHost : '127.0.0.1';
|
|
23245
23248
|
const address = server?.httpServer?.address();
|
|
23246
23249
|
const port = address && typeof address !== 'string' ? address.port : resolved.server.port;
|
|
23247
23250
|
const url = createDeviceLogUploadUrl(resolved.server.https ? 'https' : 'http', host, port);
|
|
@@ -23259,9 +23262,14 @@ function resolveHmrWebSocketUrls(resolved, server) {
|
|
|
23259
23262
|
// 与 Vite client 一致:显式 clientPort/port 优先,否则从加载入口推导。
|
|
23260
23263
|
const port = options.clientPort || options.port || source.port;
|
|
23261
23264
|
const endpoint = new URL(`${protocol}://${normalizedHost}${port ? `:${port}` : ''}`);
|
|
23262
|
-
if (!['ws:', 'wss:'].includes(endpoint.protocol) ||
|
|
23263
|
-
|
|
23264
|
-
|
|
23265
|
+
if (!['ws:', 'wss:'].includes(endpoint.protocol) ||
|
|
23266
|
+
endpoint.hostname.includes('*') ||
|
|
23267
|
+
['0.0.0.0', '[::]'].includes(endpoint.hostname) ||
|
|
23268
|
+
endpoint.username ||
|
|
23269
|
+
endpoint.password ||
|
|
23270
|
+
endpoint.pathname !== '/' ||
|
|
23271
|
+
endpoint.search ||
|
|
23272
|
+
endpoint.hash)
|
|
23265
23273
|
return [];
|
|
23266
23274
|
return [endpoint.origin];
|
|
23267
23275
|
}
|
package/dist/vite.esm.js
CHANGED
|
@@ -11290,7 +11290,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
11290
11290
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
11291
11291
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
11292
11292
|
? undefined
|
|
11293
|
-
: '0.9.9-alpha.
|
|
11293
|
+
: '0.9.9-alpha.12';
|
|
11294
11294
|
|
|
11295
11295
|
/**
|
|
11296
11296
|
* network.request 诊断日志的纯脱敏工具。
|
|
@@ -22589,7 +22589,8 @@ const diagnosticsOwner = (diagnosticsOwnerRegistry[diagnosticsOwnerKey] ??= new
|
|
|
22589
22589
|
* @since 0.3.1
|
|
22590
22590
|
*/
|
|
22591
22591
|
function miniappManifest() {
|
|
22592
|
-
const
|
|
22592
|
+
const mobilePreview = process.env.HB_SDK_MOBILE_PREVIEW === '1';
|
|
22593
|
+
const includeCompanions = !mobilePreview && process.env.HB_SDK_SKIP_COMPANIONS !== '1';
|
|
22593
22594
|
const diagnosticsSessionId = process.env.HB_SDK_DEV_DIAGNOSTICS_SESSION_ID;
|
|
22594
22595
|
const managedDiagnostics = diagnosticsSessionId ? getDevDiagnosticsSession(diagnosticsSessionId) : undefined;
|
|
22595
22596
|
if (diagnosticsSessionId && !managedDiagnostics)
|
|
@@ -22629,7 +22630,7 @@ function miniappManifest() {
|
|
|
22629
22630
|
}
|
|
22630
22631
|
return {
|
|
22631
22632
|
...(config.base === undefined ? { base: './' } : {}),
|
|
22632
|
-
...(buildTargets ? { build: { target: buildTargets } } : {}),
|
|
22633
|
+
...(buildTargets ? { build: { target: buildTargets, ...(mobilePreview ? { sourcemap: false, emptyOutDir: true } : {}) } } : {}),
|
|
22633
22634
|
define: {
|
|
22634
22635
|
[sdkVersionBuildConstant]: JSON.stringify(resolveSdkVersion()),
|
|
22635
22636
|
},
|
|
@@ -22995,6 +22996,9 @@ function miniappManifest() {
|
|
|
22995
22996
|
if (isLegacyMobileTemplatePlatforms(platforms))
|
|
22996
22997
|
this.warn(getLegacyMobileTemplatePlatformsNotice());
|
|
22997
22998
|
const parsedPermissions = readMiniappPermissionsFromPackageJson(root, sdkVersion);
|
|
22999
|
+
// 手机构建与其独立签发的开发快照使用相同权限,不携带桌面 Companion。
|
|
23000
|
+
if (mobilePreview && parsedPermissions.permissions)
|
|
23001
|
+
delete parsedPermissions.permissions.companion;
|
|
22998
23002
|
const windowDeclaration = readMiniappWindowFromPackageJson(root);
|
|
22999
23003
|
const companionConfig = readMiniappCompanionsFromPackageJson(root);
|
|
23000
23004
|
const companionDeclarations = includeCompanions ? companionConfig.declarations : undefined;
|
|
@@ -23237,8 +23241,7 @@ function resolveHmrWebSocketUrls(resolved, server) {
|
|
|
23237
23241
|
const urls = [...(server?.resolvedUrls?.local ?? []), ...(server?.resolvedUrls?.network ?? [])];
|
|
23238
23242
|
if (urls.length === 0) {
|
|
23239
23243
|
const configuredHost = resolved.server.host;
|
|
23240
|
-
const host = typeof configuredHost === 'string' && configuredHost !== '0.0.0.0' && configuredHost !== '::'
|
|
23241
|
-
? configuredHost : '127.0.0.1';
|
|
23244
|
+
const host = typeof configuredHost === 'string' && configuredHost !== '0.0.0.0' && configuredHost !== '::' ? configuredHost : '127.0.0.1';
|
|
23242
23245
|
const address = server?.httpServer?.address();
|
|
23243
23246
|
const port = address && typeof address !== 'string' ? address.port : resolved.server.port;
|
|
23244
23247
|
const url = createDeviceLogUploadUrl(resolved.server.https ? 'https' : 'http', host, port);
|
|
@@ -23256,9 +23259,14 @@ function resolveHmrWebSocketUrls(resolved, server) {
|
|
|
23256
23259
|
// 与 Vite client 一致:显式 clientPort/port 优先,否则从加载入口推导。
|
|
23257
23260
|
const port = options.clientPort || options.port || source.port;
|
|
23258
23261
|
const endpoint = new URL(`${protocol}://${normalizedHost}${port ? `:${port}` : ''}`);
|
|
23259
|
-
if (!['ws:', 'wss:'].includes(endpoint.protocol) ||
|
|
23260
|
-
|
|
23261
|
-
|
|
23262
|
+
if (!['ws:', 'wss:'].includes(endpoint.protocol) ||
|
|
23263
|
+
endpoint.hostname.includes('*') ||
|
|
23264
|
+
['0.0.0.0', '[::]'].includes(endpoint.hostname) ||
|
|
23265
|
+
endpoint.username ||
|
|
23266
|
+
endpoint.password ||
|
|
23267
|
+
endpoint.pathname !== '/' ||
|
|
23268
|
+
endpoint.search ||
|
|
23269
|
+
endpoint.hash)
|
|
23262
23270
|
return [];
|
|
23263
23271
|
return [endpoint.origin];
|
|
23264
23272
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heybox/hb-sdk",
|
|
3
|
-
"version": "0.9.9-alpha.
|
|
3
|
+
"version": "0.9.9-alpha.12",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"./src/index.ts",
|
|
6
6
|
"./src/core/singleton.ts",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"undici": "^7.28.0",
|
|
89
89
|
"ws": "^8.18.0",
|
|
90
90
|
"sharp": "^0.34.5",
|
|
91
|
-
"@heybox/hb-sdk-protocol": "0.9.9-alpha.
|
|
91
|
+
"@heybox/hb-sdk-protocol": "0.9.9-alpha.12"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"vite": ">=5"
|
|
@@ -141,11 +141,12 @@
|
|
|
141
141
|
"rollup-plugin-dts": "6.4.0",
|
|
142
142
|
"playwright-core": "1.64.1",
|
|
143
143
|
"@heybox-domain/heybox-theme": "~0.1.0",
|
|
144
|
+
"@heybox/hb-api": "~1.28.31",
|
|
145
|
+
"@heybox/hb-sdk-runtime": "~0.9.9-alpha.12",
|
|
144
146
|
"@heybox-domain/heybox-vue3-ui": "~0.1.0",
|
|
145
|
-
"@heybox/hb-api": "~1.28.27",
|
|
146
|
-
"@heybox/hb-sdk-runtime": "~0.9.9-alpha.1",
|
|
147
147
|
"@heybox/runtime": "~0.2.2",
|
|
148
148
|
"@heybox/runtime-policy": "~0.2.2",
|
|
149
|
+
"@heybox/runtime-security": "~0.2.2",
|
|
149
150
|
"@heybox/runtime-transport-fetch": "~0.2.2"
|
|
150
151
|
},
|
|
151
152
|
"publishConfig": {
|
package/skill/SKILL.md
CHANGED
|
@@ -70,6 +70,13 @@ After the mini-program purpose is clear, after completing its main functionality
|
|
|
70
70
|
- Search results are candidates, not proof that binding is valid. Never guess appids, assume every id is a Steam App ID, or choose the first result merely by ranking. Ask a short question when names, editions or platforms remain ambiguous. Tools without a specific game may remain unbound. Do not invent a separate project category or persist a reminder preference. Do not clear existing bindings without intended removal. Explain an unresolved binding decision without changing category to bypass warnings. A deferred or ambiguous decision must remain unresolved so the next publishing guide can ask again.
|
|
71
71
|
- Treat metadata warnings as actionable suggestions and fix confirmed omissions within the authorized scope. Missing optional metadata must not block development or publication, and a warning does not authorize remote publication. Leave invalid-value errors to the documented validation rules.
|
|
72
72
|
|
|
73
|
+
## Proactive PC Adaptation
|
|
74
|
+
|
|
75
|
+
- After the purpose is clear, assess whether desktop use benefits the project (for example game reference, build planning, or data tools). Proactively explain that Workshop mini-programs can also target PC, and offer to help adapt suitable projects. Avoid repeating promotion in unrelated answers.
|
|
76
|
+
- Read the PC adaptation guide selected from the fresh canonical index for the maintained client download entry, platform configuration, desktop preview, and real-client validation. Share that download entry when recommending PC use; never guess installer URLs or supported systems.
|
|
77
|
+
- Before build or audit submission, check desktop suitability even when the template already declares desktop platforms. Validate responsive windows, mouse/keyboard interaction, and the actual SDK capabilities used on each claimed platform. Browser preview and successful builds do not establish real-client support.
|
|
78
|
+
- Explain any target declaration needed for local client debugging, and keep release platforms limited to those adapted and verified. Do not silently add platforms or claim verification without evidence. Respect an explicit mobile-only decision, keep suggestions non-blocking, and report any unverified desktop declarations before submission.
|
|
79
|
+
|
|
73
80
|
## Troubleshooting and Proactive Feedback
|
|
74
81
|
|
|
75
82
|
- Investigate and fix application code, configuration, dependency-version, and permission errors using the official documentation first. A single error does not establish an SDK defect. Do not misclassify undeclared permissions, missing authorization, or platform limitations as SDK defects.
|
package/skill/skill.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.9.9-alpha.
|
|
3
|
+
"skillVersion": "0.9.9-alpha.12+skill.ebdc6208c358",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.9.9-alpha.
|
|
7
|
-
"compatibility": "0.9.9-alpha.
|
|
6
|
+
"version": "0.9.9-alpha.12",
|
|
7
|
+
"compatibility": "0.9.9-alpha.12"
|
|
8
8
|
},
|
|
9
9
|
"distribution": {
|
|
10
10
|
"type": "npm",
|
|
11
11
|
"package": "@heybox/hb-sdk",
|
|
12
|
-
"version": "0.9.9-alpha.
|
|
12
|
+
"version": "0.9.9-alpha.12",
|
|
13
13
|
"path": "skill"
|
|
14
14
|
},
|
|
15
|
-
"integrity": "sha256-
|
|
15
|
+
"integrity": "sha256-ebdc6208c35883b0fccf9bb50a43e096c9b89644a4cd000e0d931bdaf3d13d64"
|
|
16
16
|
}
|
package/types/vite/index.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ interface MiniappManifestUserConfig {
|
|
|
73
73
|
/** 生产构建始终叠加 Chrome 64 / Safari 12;更保守的项目目标继续生效。 */
|
|
74
74
|
build?: {
|
|
75
75
|
target?: string | string[] | false;
|
|
76
|
+
sourcemap?: boolean | 'inline' | 'hidden';
|
|
77
|
+
emptyOutDir?: boolean;
|
|
76
78
|
};
|
|
77
79
|
/** 生产构建不能关闭 esbuild;具体编译选项由 Vite 定义。 */
|
|
78
80
|
esbuild?: object | false;
|