@heybox/hb-sdk 0.6.4 → 0.6.5
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/dist/cli-chunks/{context-BEgbP7mM.cjs → context-DjepdCaa.cjs} +1 -1
- package/dist/cli-chunks/{create-BHsWWo3V.cjs → create-D3BBKay9.cjs} +1 -1
- package/dist/cli-chunks/{dev-CSjs2OYB.cjs → dev-C3u5FXIy.cjs} +4 -4
- package/dist/cli-chunks/{doctor-B3AOQgyN.cjs → doctor-DEgZa2qC.cjs} +1 -1
- package/dist/cli-chunks/{index-BGFf6g7V.cjs → index-B5gEl9ow.cjs} +2 -2
- package/dist/cli-chunks/{index-B0zGksOA.cjs → index-CKat0ExC.cjs} +13 -13
- package/dist/cli-chunks/{login-ClQuL2r6.cjs → login-B6gERpSX.cjs} +2 -2
- package/dist/cli-chunks/{remote-ib5THDbw.cjs → remote-BfQiZzeJ.cjs} +4 -4
- package/dist/cli-chunks/{session-D7nmqMiy.cjs → session-DPEq__gB.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/templates/vue3-vite-ts/README.md.ejs +4 -8
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.esm.js +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +33 -47
- package/skill/references/api-root.md +1 -1
- package/skill/references/cli.md +66 -237
- package/skill/references/recipes.md +20 -28
- package/skill/scripts/sync-references.mjs +33 -53
- package/skill/skill.json +4 -4
|
@@ -93,7 +93,16 @@ function rewriteBundledRecipeLinks(markdown) {
|
|
|
93
93
|
return markdown
|
|
94
94
|
.replaceAll('(../recipes/custom-instance)', '(#custom-instance-recipe)')
|
|
95
95
|
.replaceAll('(../reference/protocol/interfaces/MiniProgramEventPayloadMap)', '(api-root.md)')
|
|
96
|
-
.replaceAll('(../reference/protocol/types/#miniprogrameventname)', '(api-root.md)')
|
|
96
|
+
.replaceAll('(../reference/protocol/types/#miniprogrameventname)', '(api-root.md)')
|
|
97
|
+
.replaceAll('(../reference/root/classes/HbMiniProgramSDKError)', '(api-root.md)')
|
|
98
|
+
.replaceAll('(../reference/root/classes/HbMiniProgramNetworkError)', '(api-root.md)');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function rewriteBundledCliLinks(markdown) {
|
|
102
|
+
return markdown.replaceAll(
|
|
103
|
+
'(./mini-program-publishing-rules)',
|
|
104
|
+
'(https://docs.xiaoheihe.cn/hb_sdk/guide/mini-program-publishing-rules)',
|
|
105
|
+
);
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
function rewriteBundledProtocolIndexLinks(markdown) {
|
|
@@ -191,7 +200,6 @@ const rootEntry = read('packages/hb-sdk/src/index.ts');
|
|
|
191
200
|
const protocolEntry = read('packages/hb-sdk/src/protocol.ts');
|
|
192
201
|
const viteEntry = read('packages/hb-sdk/src/vite/index.ts');
|
|
193
202
|
const cliEntry = read('packages/hb-sdk/src/cli/index.ts');
|
|
194
|
-
const cliTemplateReadme = read('packages/hb-sdk/src/cli/templates/vue3-vite-ts/README.md.ejs');
|
|
195
203
|
const readme = read('packages/hb-sdk/README.md');
|
|
196
204
|
const cliGuide = frontmatterless(read('apps/docs/hb-sdk/guide/cli.md'));
|
|
197
205
|
const quickStart = frontmatterless(read('apps/docs/hb-sdk/guide/quick-start.md'));
|
|
@@ -210,20 +218,16 @@ const sdkRuntimeRelation = extractSection(readme, '## SDK 与 Runtime');
|
|
|
210
218
|
const capabilityBoundaries = extractSection(readme, '## 能力边界');
|
|
211
219
|
const manifestSection = extractSection(readme, '## Manifest');
|
|
212
220
|
const cliSummarySection = extractSection(readme, '## CLI');
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
const cliDevSection = [
|
|
216
|
-
extractSection(cliGuide, '## 本地开发模式'),
|
|
217
|
-
extractSection(cliGuide, '## Mock runtime 边界'),
|
|
218
|
-
].filter(Boolean).join('\n\n');
|
|
221
|
+
const cliCreateSection = extractSection(cliGuide, '## 创建工坊小程序');
|
|
222
|
+
const cliDevSection = extractSection(cliGuide, '## 推荐调试流程');
|
|
219
223
|
const cliDeploySection = extractSection(cliGuide, '## 部署发布');
|
|
220
224
|
const cliRemoteSection = extractSection(cliGuide, '## 远端管理命令');
|
|
221
225
|
const cliLoginSection = extractSection(cliGuide, '## CLI 登录态');
|
|
222
226
|
const cliDoctorSection = extractSection(cliGuide, '## Agent Skill doctor');
|
|
223
227
|
const cliUpdateSection = extractSection(cliGuide, '## 版本提醒');
|
|
224
228
|
const cliCommandSurface = `hb-sdk create <project-name>
|
|
225
|
-
hb-sdk dev [--port <port>] [--mock-port <port>] [--
|
|
226
|
-
hb-sdk login
|
|
229
|
+
hb-sdk dev [--port <port>] [--mock-port <port>] [--no-open]
|
|
230
|
+
hb-sdk login
|
|
227
231
|
hb-sdk login status
|
|
228
232
|
hb-sdk login clear
|
|
229
233
|
hb-sdk doctor
|
|
@@ -251,17 +255,15 @@ hb-sdk remote square show
|
|
|
251
255
|
|
|
252
256
|
Removed: hb-sdk deploy`;
|
|
253
257
|
|
|
254
|
-
const cliRemoteEntitySection = `Developer
|
|
258
|
+
const cliRemoteEntitySection = `Developer account selection lives under \`hb-sdk remote entity\`:
|
|
255
259
|
|
|
256
260
|
${fenced('bash', `hb-sdk remote entity list
|
|
257
261
|
hb-sdk remote entity current
|
|
258
262
|
hb-sdk remote entity switch <entity-id>`)}
|
|
259
263
|
|
|
260
|
-
|
|
264
|
+
Remote management commands use the current developer account. Use \`current\` to confirm it and \`switch\` to change it before creating, binding, or publishing a mini-program.`;
|
|
261
265
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const cliRemoteEntityDeploySection = `Before precheck, build, upload, or submit audit, \`hb-sdk remote deploy\` must verify that the current project's bound mini-program belongs to the server-side current entity. If \`detail.entity_id\` differs from the current entity, the command fails with both entity ids/names and suggests \`hb-sdk remote entity switch <entity-id>\`. It must not auto-switch entities and must not continue into precheck/build/upload/submit on mismatch.`;
|
|
266
|
+
const cliRemoteEntityDeploySection = `Before publishing, \`hb-sdk remote deploy\` verifies that the bound mini-program belongs to the current developer account. If it does not, the command stops and asks the user to switch accounts.`;
|
|
265
267
|
|
|
266
268
|
const files = new Map();
|
|
267
269
|
|
|
@@ -343,29 +345,23 @@ files.set('cli.md', `${header('CLI reference', [
|
|
|
343
345
|
'packages/hb-sdk/src/cli/commands/create.ts',
|
|
344
346
|
'packages/hb-sdk/src/cli/commands/dev.ts',
|
|
345
347
|
'packages/hb-sdk/src/cli/commands/login.ts',
|
|
346
|
-
'packages/hb-sdk/src/cli/templates/vue3-vite-ts/README.md.ejs',
|
|
347
348
|
'apps/docs/hb-sdk/guide/cli.md',
|
|
348
|
-
'packages/hb-sdk/README.md',
|
|
349
349
|
])}${contents([
|
|
350
350
|
['When to use the CLI', 'when-to-use-the-cli'],
|
|
351
351
|
['Command surface', 'command-surface'],
|
|
352
352
|
['Create a mini-program template', 'create-a-mini-program-template'],
|
|
353
|
-
['Local
|
|
354
|
-
['Deploy and
|
|
355
|
-
['
|
|
353
|
+
['Local debugging', 'local-debugging'],
|
|
354
|
+
['Deploy and publish', 'deploy-and-publish'],
|
|
355
|
+
['Developer account scope', 'developer-account-scope'],
|
|
356
356
|
['Remote management commands', 'remote-management-commands'],
|
|
357
|
-
['CLI login
|
|
357
|
+
['CLI login', 'cli-login'],
|
|
358
358
|
['Agent Skill doctor', 'agent-skill-doctor'],
|
|
359
359
|
['Update reminders', 'update-reminders'],
|
|
360
|
-
['Repository validation commands', 'repository-validation-commands'],
|
|
361
|
-
['Generated template README', 'generated-template-readme'],
|
|
362
360
|
])}## When to use the CLI
|
|
363
361
|
|
|
364
|
-
Use the bundled \`hb-sdk\` CLI
|
|
362
|
+
Use the bundled \`hb-sdk\` CLI to create a workshop mini-program, open the local debugging page, test in the Heybox Mac or mobile App, or manage and publish a remote mini-program.
|
|
365
363
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
The CLI, templates, and mock host are owned by \`${packageJson.name}\`. Do not create a second mock runtime package or move CLI guidance outside this package unless the package boundary changes.
|
|
364
|
+
\`hb-sdk login\` is for development and publishing commands only. It does not change \`auth.login()\`, \`user.getInfo()\`, or \`network.request()\` inside a mini-program.
|
|
369
365
|
|
|
370
366
|
## Command surface
|
|
371
367
|
|
|
@@ -379,20 +375,20 @@ ${cliCreateSection}
|
|
|
379
375
|
|
|
380
376
|
Agent rules:
|
|
381
377
|
|
|
382
|
-
- Prefer \`hb-sdk create <project-name>\` for a new
|
|
378
|
+
- Prefer \`hb-sdk create <project-name>\` for a new workshop mini-program.
|
|
383
379
|
- After creation, the expected next steps are \`npm install\` and \`npm run dev\`.
|
|
384
380
|
- Do not claim the CLI installs dependencies, initializes git, opens an editor, or overwrites non-empty directories.
|
|
385
381
|
- Treat \`project-name\` as an unscoped npm package name and project directory.
|
|
386
382
|
|
|
387
|
-
## Local
|
|
383
|
+
## Local debugging
|
|
388
384
|
|
|
389
385
|
${cliDevSection}
|
|
390
386
|
|
|
391
|
-
Use \`hb-sdk dev\`
|
|
387
|
+
Use \`hb-sdk dev\` to open the local debugging page. The "在 Mac 版 APP 中启动" button opens the page in the Mac App; the "Mobile App" QR code opens it in the phone App after a LAN interface is selected. These entries remain available without CLI login or project binding, but managed capabilities are denied by default. The phone and computer must be on the same LAN. If an embedded browser cannot open the App, use the system browser.
|
|
392
388
|
|
|
393
|
-
## Deploy and
|
|
389
|
+
## Deploy and publish
|
|
394
390
|
|
|
395
|
-
${cliDeploySection}
|
|
391
|
+
${rewriteBundledCliLinks(cliDeploySection)}
|
|
396
392
|
|
|
397
393
|
${cliRemoteEntityDeploySection}
|
|
398
394
|
|
|
@@ -400,25 +396,18 @@ Agent rules:
|
|
|
400
396
|
|
|
401
397
|
- Use \`hb-sdk remote deploy --release-note <text>\` for normal build, upload, and submit-audit flows.
|
|
402
398
|
- Use \`hb-sdk remote deploy --from-version <version> --release-note <text>\` to reuse a remote history artifact.
|
|
403
|
-
-
|
|
399
|
+
- If the bound mini-program does not belong to the current developer account, stop and ask the user to switch accounts.
|
|
404
400
|
- Never recommend top-level \`hb-sdk deploy\`; it has been removed rather than retained as a compatibility alias.
|
|
405
401
|
- After non-auto deploy succeeds, suggest \`hb-sdk remote versions\` and then \`hb-sdk remote release <version>\` after approval. Do not send the user to Open for manual publish when the CLI command exists.
|
|
406
402
|
- Use \`hb-sdk remote allowlist add <heybox_id>\` when preview access needs to be granted.
|
|
407
|
-
- Use \`--api-base-url <url>\` or \`HB_SDK_API_BASE_URL\` for remote platform backend APIs.
|
|
408
|
-
- Use \`--allow-unsafe-api-base-url\` or \`HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1\` only for local backend debugging against non-Heybox or non-HTTPS API origins.
|
|
409
|
-
- Use \`--login-base-url <url>\` or \`HB_SDK_LOGIN_BASE_URL\` for CLI browser login and remote command login-environment validation.
|
|
410
|
-
- Use \`packages/hb-sdk/src/cli/config.ts\` with \`RylaiServiceTagConfig\` only when Heybox backend API requests need the development-only \`x-rylai-service-tag\` header and matching \`special_tag\` query parameter.
|
|
411
|
-
- Custom base URLs must be origin-only; API origins must be Heybox trusted HTTPS unless the unsafe debug switch is explicit. Do not include path, query, or hash.
|
|
412
|
-
- Do not expect custom base URLs to affect \`hb-sdk doctor\`, npm latest checks, or mock-host \`network.request()\`.
|
|
413
403
|
|
|
414
|
-
##
|
|
404
|
+
## Developer account scope
|
|
415
405
|
|
|
416
406
|
${cliRemoteEntitySection}
|
|
417
407
|
|
|
418
408
|
Agent rules:
|
|
419
409
|
|
|
420
|
-
- Treat the
|
|
421
|
-
- 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.
|
|
410
|
+
- Treat the current developer account as the scope for remote create, bind, deploy, list, access, versions, preview, release, withdraw, take-down, reopen, and square-display workflows.
|
|
422
411
|
- Use \`hb-sdk remote entity current\` when a user needs to confirm which entity create/deploy will use.
|
|
423
412
|
- 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.
|
|
424
413
|
- \`hb-sdk remote list\` lists mini-programs in the current entity scope only; do not promise cross-entity aggregation.
|
|
@@ -440,14 +429,13 @@ Agent rules:
|
|
|
440
429
|
- 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\`.
|
|
441
430
|
- Use \`--json\` for script consumption and keep stdout as exactly one JSON object.
|
|
442
431
|
|
|
443
|
-
## CLI login
|
|
432
|
+
## CLI login
|
|
444
433
|
|
|
445
434
|
${cliLoginSection}
|
|
446
435
|
|
|
447
436
|
Agent rules:
|
|
448
437
|
|
|
449
|
-
- Keep CLI
|
|
450
|
-
- Keep \`selectedEntity\` guidance explicit: it is only a hint snapshot, while every remote command uses the server-side current entity.
|
|
438
|
+
- Keep CLI login separate from the mini-program user login state.
|
|
451
439
|
- It is correct to say status output is redacted.
|
|
452
440
|
- Do not expose or template pkey, cookie, token, or private credential values.
|
|
453
441
|
- Use \`hb-sdk login clear\` only to clear the \`hb-sdk\` CLI namespace.
|
|
@@ -461,19 +449,11 @@ Agent rules:
|
|
|
461
449
|
- Use \`hb-sdk doctor\` for read-only diagnosis of local SDK, remote latest skill metadata, and local skill metadata.
|
|
462
450
|
- Do not use \`hb-sdk doctor\` to auto-install skills; when installation or refresh is needed, tell the user to run \`npx skills add https://open.xiaoheihe.cn/agent-skills/hb-sdk\`.
|
|
463
451
|
- If doctor reports \`SDK_MISMATCH\`, tell the user to upgrade \`${packageJson.name}@latest\` before reinstalling the skill.
|
|
464
|
-
- The supported local skill path is \`$CODEX_HOME/skills/hb-sdk/skill.json\`, falling back to \`~/.codex/skills/hb-sdk/skill.json\`.
|
|
465
452
|
|
|
466
453
|
## Update reminders
|
|
467
454
|
|
|
468
455
|
${cliUpdateSection}
|
|
469
456
|
|
|
470
|
-
## Repository validation commands
|
|
471
|
-
|
|
472
|
-
${repositoryDevelopment}
|
|
473
|
-
|
|
474
|
-
## Generated template README
|
|
475
|
-
|
|
476
|
-
${fenced('md', cliTemplateReadme)}
|
|
477
457
|
`);
|
|
478
458
|
|
|
479
459
|
files.set('recipes.md', `${header('Recipes', [
|
package/skill/skill.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.6.
|
|
3
|
+
"skillVersion": "0.6.5+skill.648cee8ae511",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.6.
|
|
7
|
-
"compatibility": "0.6.
|
|
6
|
+
"version": "0.6.5",
|
|
7
|
+
"compatibility": "0.6.5"
|
|
8
8
|
},
|
|
9
9
|
"source": "https://open.xiaoheihe.cn/agent-skills/hb-sdk",
|
|
10
|
-
"integrity": "sha256-
|
|
10
|
+
"integrity": "sha256-648cee8ae5111e01f8e69264187b9501c9167eca7c53693079e2a487ef230106"
|
|
11
11
|
}
|