@heybox/hb-sdk 0.9.1-alpha.4 → 0.9.1-alpha.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/CHANGELOG.md +10 -2
- package/README.md +11 -0
- package/dist/card-controller.cjs.js +194 -0
- package/dist/card-controller.esm.js +159 -0
- package/dist/cli-chunks/{build-BZg2rHkW.cjs → build-D91J_GAa.cjs} +13 -7
- package/dist/cli-chunks/{context-YrzmEOau.cjs → context-Xdd45FFd.cjs} +2 -2
- package/dist/cli-chunks/{create-fPvlqLbS.cjs → create-BzpdRC5r.cjs} +1 -1
- package/dist/cli-chunks/{dev-X8_kbp78.cjs → dev-C7acO3Kt.cjs} +55 -9
- package/dist/cli-chunks/{doctor-DdiucYs9.cjs → doctor-BgHRDQmG.cjs} +1 -1
- package/dist/cli-chunks/{index-BdbwsefW.cjs → index-CjhQXbxy.cjs} +4 -7
- package/dist/cli-chunks/{index-BGh-Izf8.cjs → index-TQwjvNjL.cjs} +32 -16
- package/dist/cli-chunks/{index.esm-WYIrPjkF.cjs → index.esm-dgqkvowo.cjs} +7 -7
- package/dist/cli-chunks/{login-DWmNuhWc.cjs → login-B14iGXHh.cjs} +2 -2
- package/dist/cli-chunks/{project-vite-BVDIeoHB.cjs → project-vite-CN6mMjzX.cjs} +1 -1
- package/dist/cli-chunks/{remote-BHJFxXyc.cjs → remote-C9RUiZxK.cjs} +22 -14
- package/dist/cli-chunks/runtime-gate-CfAkz0p-.cjs +201950 -0
- package/dist/cli-chunks/{runtime-permission-env-eiq8vE62.cjs → runtime-permission-env-L7OfyRcl.cjs} +9396 -2929
- package/dist/cli-chunks/{session-Dz1cGg0E.cjs → session-DZrr6RYK.cjs} +2 -1
- package/dist/cli-chunks/{skill-DC3cfPj2.cjs → skill-BHTVho1a.cjs} +2 -2
- package/dist/cli-chunks/{version-DYFkOykv.cjs → version-C_NaCZ8O.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-KPFU0Lsa.js +102 -0
- package/dist/devtools/browser-dev-host/assets/{desktop-app-launch-CZsodKbP.js → desktop-app-launch-BNF9Yk4P.js} +3 -3
- package/dist/devtools/browser-dev-host/assets/{index-B9tOX3zG.js → index-DRRtB9Nm.js} +4 -4
- package/dist/devtools/browser-dev-host/index.html +2 -2
- package/dist/index.cjs.js +6224 -275
- package/dist/index.esm.js +6224 -276
- package/dist/miniapp-publish.cjs.js +6612 -168
- package/dist/miniapp-publish.esm.js +6612 -169
- package/dist/protocol.cjs.js +5805 -0
- package/dist/protocol.esm.js +5805 -0
- package/dist/vite.cjs.js +7475 -217
- package/dist/vite.esm.js +7474 -218
- package/dist/workspace-card-build-sandbox-worker.mjs +72 -0
- package/package.json +25 -11
- package/skill/skill.json +4 -4
- package/types/card-controller.d.ts +3682 -0
- package/types/index.d.ts +7532 -35
- package/types/miniapp-publish/index.d.ts +542 -64
- package/types/protocol.d.ts +2083 -9
- package/types/vite/index.d.ts +25 -12
- package/dist/cli-chunks/runtime-gate-CR0dRMpQ.cjs +0 -65
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-CO2_03W0.js +0 -102
- package/types/core/client.d.ts +0 -108
- package/types/core/csp-violation.d.ts +0 -5
- package/types/core/errors.d.ts +0 -78
- package/types/core/event-bus.d.ts +0 -11
- package/types/core/handshake-state.d.ts +0 -54
- package/types/core/history-observer.d.ts +0 -4
- package/types/core/mini-dev-console.d.ts +0 -36
- package/types/core/network-sanitize.d.ts +0 -31
- package/types/core/sdk.d.ts +0 -104
- package/types/core/singleton.d.ts +0 -372
- package/types/core/utils.d.ts +0 -10
- package/types/core/version.d.ts +0 -2
- package/types/devtools/device-logs.d.ts +0 -48
- package/types/miniapp-manifest/basic-info-browser.d.ts +0 -37
- package/types/miniapp-manifest/basic-info-image-header.d.ts +0 -6
- package/types/miniapp-manifest/basic-info-node.d.ts +0 -17
- package/types/miniapp-manifest/basic-info-placeholder.d.ts +0 -1
- package/types/miniapp-manifest/basic-info.d.ts +0 -33
- package/types/miniapp-manifest/bindings.d.ts +0 -70
- package/types/miniapp-manifest/category.d.ts +0 -11
- package/types/miniapp-manifest/companion-directory.d.ts +0 -2
- package/types/miniapp-manifest/companion-executable.d.ts +0 -4
- package/types/miniapp-manifest/companion-types.d.ts +0 -63
- package/types/miniapp-manifest/companions.d.ts +0 -17
- package/types/miniapp-manifest/index.d.ts +0 -7
- package/types/miniapp-manifest/node.d.ts +0 -22
- package/types/miniapp-manifest/permissions.d.ts +0 -48
- package/types/miniapp-manifest/runtime-gate.d.ts +0 -12
- package/types/miniapp-manifest/schema.d.ts +0 -302
- package/types/modules/auth/index.d.ts +0 -204
- package/types/modules/cloud/index.d.ts +0 -669
- package/types/modules/companion/index.d.ts +0 -1619
- package/types/modules/device/index.d.ts +0 -269
- package/types/modules/environment/index.d.ts +0 -238
- package/types/modules/files/index.d.ts +0 -5
- package/types/modules/files/registry.d.ts +0 -35
- package/types/modules/files/types.d.ts +0 -1548
- package/types/modules/navigation/app-pages/index.d.ts +0 -4
- package/types/modules/navigation/app-pages/types.d.ts +0 -135
- package/types/modules/navigation/index.d.ts +0 -312
- package/types/modules/network/index.d.ts +0 -457
- package/types/modules/network/observability.d.ts +0 -38
- package/types/modules/network/request-shape.d.ts +0 -44
- package/types/modules/share/copy-link.d.ts +0 -46
- package/types/modules/share/extra.d.ts +0 -5
- package/types/modules/share/index.d.ts +0 -294
- package/types/modules/share/screenshot.d.ts +0 -34
- package/types/modules/share/show-share-menu.d.ts +0 -29
- package/types/modules/share/types.d.ts +0 -201
- package/types/modules/storage/index.d.ts +0 -214
- package/types/modules/ui/index.d.ts +0 -315
- package/types/modules/user/get-info.d.ts +0 -44
- package/types/modules/user/index.d.ts +0 -245
- package/types/modules/user/revoke-authorization.d.ts +0 -31
- package/types/modules/user/steam-game-list.d.ts +0 -153
- package/types/modules/user/types.d.ts +0 -2
- package/types/modules/viewport/index.d.ts +0 -319
- package/types/protocol/capabilities.d.ts +0 -2
- package/types/protocol/constants.d.ts +0 -1
- package/types/protocol/dev-session.d.ts +0 -74
- package/types/protocol/guards.d.ts +0 -1
- package/types/protocol/runtime-permissions.d.ts +0 -2
- package/types/protocol/types.d.ts +0 -22
- package/types/skill-metadata.d.ts +0 -18
- package/types/vite/html-policy.d.ts +0 -6
- package/types/vite/runtime-permission-env.d.ts +0 -9
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { newQuickJSWASMModuleFromVariant } from 'quickjs-emscripten-core';
|
|
3
|
+
|
|
4
|
+
function output(message) {
|
|
5
|
+
process.stdout.write(`${JSON.stringify(message)}\n`);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
const input = readFileSync(0, 'utf8');
|
|
10
|
+
if (Buffer.byteLength(input, 'utf8') > 1_100_000) throw new Error('INPUT_TOO_LARGE');
|
|
11
|
+
const request = JSON.parse(input);
|
|
12
|
+
if (!request || typeof request.source !== 'string' || Buffer.byteLength(request.source, 'utf8') > 1_048_576) throw new Error('SOURCE_TOO_LARGE');
|
|
13
|
+
const source = request.source;
|
|
14
|
+
const quickjs = await newQuickJSWASMModuleFromVariant(import('@jitl/quickjs-wasmfile-release-sync'));
|
|
15
|
+
const deadline = Date.now() + 500;
|
|
16
|
+
const runtime = quickjs.newRuntime({ memoryLimitBytes: 64 * 1024 * 1024, maxStackSizeBytes: 512 * 1024, interruptHandler: () => Date.now() > deadline });
|
|
17
|
+
const context = runtime.newContext();
|
|
18
|
+
try {
|
|
19
|
+
const materializer = context.evalCode(`(() => {
|
|
20
|
+
const entries = Object.entries;
|
|
21
|
+
const hasOwn = Object.hasOwn;
|
|
22
|
+
const map = Array.prototype.map;
|
|
23
|
+
const apply = Reflect.apply;
|
|
24
|
+
const stringify = JSON.stringify;
|
|
25
|
+
return author => stringify({
|
|
26
|
+
networkOrigins: author.networkOrigins ?? [],
|
|
27
|
+
hasRefresh: typeof author.refresh === 'function',
|
|
28
|
+
cards: apply(map, apply(entries, Object, [author.cards]), [([id, card]) => ({
|
|
29
|
+
id, title: card.title, sizes: { allowed: card.sizes, default: card.defaultSize },
|
|
30
|
+
hasDocuments: hasOwn(card, 'documents'),
|
|
31
|
+
hasLoadingDocuments: hasOwn(card, 'loadingDocuments'),
|
|
32
|
+
hasErrorDocuments: hasOwn(card, 'errorDocuments'),
|
|
33
|
+
documents: card.documents,
|
|
34
|
+
loadingDocuments: card.loadingDocuments,
|
|
35
|
+
errorDocuments: card.errorDocuments,
|
|
36
|
+
})]),
|
|
37
|
+
actions: apply(map, apply(entries, Object, [author.actions ?? {}]), [([id, action]) => ({
|
|
38
|
+
id, kind: action.kind, inputSchema: action.input,
|
|
39
|
+
})]),
|
|
40
|
+
});
|
|
41
|
+
})()`);
|
|
42
|
+
if (materializer.error) {
|
|
43
|
+
materializer.error.dispose();
|
|
44
|
+
throw new Error('MATERIALIZER_FAILED');
|
|
45
|
+
}
|
|
46
|
+
const result = context.evalCode(source, 'workspace-card-author.mjs', { type: 'module' });
|
|
47
|
+
if (result.error) {
|
|
48
|
+
const error = context.dump(result.error);
|
|
49
|
+
result.error.dispose();
|
|
50
|
+
materializer.value.dispose();
|
|
51
|
+
throw new Error(error?.message === 'interrupted' ? 'CPU_INTERRUPTED' : 'GUEST_FAILED');
|
|
52
|
+
}
|
|
53
|
+
const exported = context.getProp(result.value, 'default');
|
|
54
|
+
const serialized = context.callFunction(materializer.value, context.undefined, exported);
|
|
55
|
+
materializer.value.dispose();
|
|
56
|
+
exported.dispose();
|
|
57
|
+
result.value.dispose();
|
|
58
|
+
if (serialized.error) {
|
|
59
|
+
serialized.error.dispose();
|
|
60
|
+
throw new Error('MATERIALIZATION_FAILED');
|
|
61
|
+
}
|
|
62
|
+
const json = context.dump(serialized.value);
|
|
63
|
+
serialized.value.dispose();
|
|
64
|
+
if (typeof json !== 'string' || Buffer.byteLength(json, 'utf8') > 256 * 1024) throw new Error('OUTPUT_TOO_LARGE');
|
|
65
|
+
output({ ok: true, json });
|
|
66
|
+
} finally {
|
|
67
|
+
context.dispose();
|
|
68
|
+
runtime.dispose();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
main().catch(error => output({ ok: false, code: error instanceof Error ? error.message : 'SANDBOX_FAILED' }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heybox/hb-sdk",
|
|
3
|
-
"version": "0.9.1-alpha.
|
|
3
|
+
"version": "0.9.1-alpha.5",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"./src/index.ts",
|
|
6
6
|
"./src/core/singleton.ts",
|
|
@@ -11,31 +11,38 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./types/index.d.ts",
|
|
14
|
-
"heybox": "./
|
|
14
|
+
"heybox": "./dist/index.esm.js",
|
|
15
15
|
"node": "./dist/index.cjs.js",
|
|
16
16
|
"browser": "./dist/index.esm.js",
|
|
17
17
|
"default": "./dist/index.esm.js"
|
|
18
18
|
},
|
|
19
19
|
"./protocol": {
|
|
20
20
|
"types": "./types/protocol.d.ts",
|
|
21
|
-
"heybox": "./
|
|
21
|
+
"heybox": "./dist/protocol.esm.js",
|
|
22
22
|
"node": "./dist/protocol.cjs.js",
|
|
23
23
|
"browser": "./dist/protocol.esm.js",
|
|
24
24
|
"default": "./dist/protocol.esm.js"
|
|
25
25
|
},
|
|
26
26
|
"./miniapp-publish": {
|
|
27
27
|
"types": "./types/miniapp-publish/index.d.ts",
|
|
28
|
-
"heybox": "./
|
|
28
|
+
"heybox": "./dist/miniapp-publish.esm.js",
|
|
29
29
|
"node": "./dist/miniapp-publish.cjs.js",
|
|
30
30
|
"browser": "./dist/miniapp-publish.esm.js",
|
|
31
31
|
"default": "./dist/miniapp-publish.esm.js"
|
|
32
32
|
},
|
|
33
33
|
"./vite": {
|
|
34
34
|
"types": "./types/vite/index.d.ts",
|
|
35
|
-
"heybox": "./
|
|
35
|
+
"heybox": "./dist/vite.esm.js",
|
|
36
36
|
"import": "./dist/vite.esm.js",
|
|
37
37
|
"require": "./dist/vite.cjs.js",
|
|
38
38
|
"default": "./dist/vite.esm.js"
|
|
39
|
+
},
|
|
40
|
+
"./card-controller": {
|
|
41
|
+
"types": "./types/card-controller.d.ts",
|
|
42
|
+
"heybox": "./dist/card-controller.esm.js",
|
|
43
|
+
"import": "./dist/card-controller.esm.js",
|
|
44
|
+
"require": "./dist/card-controller.cjs.js",
|
|
45
|
+
"default": "./dist/card-controller.esm.js"
|
|
39
46
|
}
|
|
40
47
|
},
|
|
41
48
|
"bin": {
|
|
@@ -59,13 +66,16 @@
|
|
|
59
66
|
"node": ">=22.20.0"
|
|
60
67
|
},
|
|
61
68
|
"dependencies": {
|
|
69
|
+
"@jitl/quickjs-wasmfile-release-sync": "0.31.0",
|
|
62
70
|
"@msgpack/msgpack": "2.8.0",
|
|
63
71
|
"parse5": "^7.3.0",
|
|
72
|
+
"quickjs-emscripten-core": "0.31.0",
|
|
64
73
|
"skills": "1.5.23",
|
|
74
|
+
"typescript": "^5.9.3",
|
|
65
75
|
"undici": "^7.28.0",
|
|
66
76
|
"ws": "^8.18.0",
|
|
67
77
|
"sharp": "^0.34.5",
|
|
68
|
-
"@heybox/hb-sdk-protocol": "0.9.1-alpha.
|
|
78
|
+
"@heybox/hb-sdk-protocol": "0.9.1-alpha.5"
|
|
69
79
|
},
|
|
70
80
|
"peerDependencies": {
|
|
71
81
|
"vite": ">=5"
|
|
@@ -111,17 +121,18 @@
|
|
|
111
121
|
"semver": "^7.8.0",
|
|
112
122
|
"sass-embedded": "1.97.3",
|
|
113
123
|
"splitpanes": "^4.1.0",
|
|
114
|
-
"typescript": "^5.9.3",
|
|
115
124
|
"vue": "^3.5.22",
|
|
116
125
|
"vue-tsc": "^3.3.7",
|
|
117
126
|
"vite": "^8.0.12",
|
|
118
127
|
"vitest": "^3.2.4",
|
|
128
|
+
"@ai-desktop/view-contract": "file:../hb-sdk-protocol/vendor/view-contract-2.2.2-6ac49bbf6410.tgz",
|
|
129
|
+
"rollup-plugin-dts": "6.4.0",
|
|
119
130
|
"@heybox-domain/heybox-theme": "~0.1.0",
|
|
120
131
|
"@heybox-domain/heybox-vue3-ui": "~0.1.0",
|
|
121
|
-
"@heybox/runtime": "~0.
|
|
132
|
+
"@heybox/hb-sdk-runtime": "~0.9.1-alpha.5",
|
|
122
133
|
"@heybox/hb-api": "~1.28.14",
|
|
134
|
+
"@heybox/runtime": "~0.2.1",
|
|
123
135
|
"@heybox/runtime-policy": "~0.2.1",
|
|
124
|
-
"@heybox/hb-sdk-runtime": "~0.9.1-alpha.4",
|
|
125
136
|
"@heybox/runtime-transport-fetch": "~0.2.1"
|
|
126
137
|
},
|
|
127
138
|
"publishConfig": {
|
|
@@ -168,7 +179,7 @@
|
|
|
168
179
|
"build:cli:bundle": "node scripts/check-workspace-builds.cjs && rollup -c rollup.config.ts --environment HB_SDK_BUILD:cli --configPlugin 'typescript={\"tsconfig\":\"tsconfig.build.json\"}' && pnpm run build:browser-dev-host",
|
|
169
180
|
"build:browser-dev-host": "vite build --config vite.browser-dev-host.config.ts && node scripts/check-browser-dev-host-assets.cjs && node scripts/generate-browser-dev-host-notices.cjs",
|
|
170
181
|
"build:templates": "node scripts/copy-cli-templates.cjs",
|
|
171
|
-
"build:types": "tsc -p tsconfig.dts.json",
|
|
182
|
+
"build:types": "tsc -p tsconfig.dts.json && node ../hb-sdk-protocol/scripts/bundle-declarations.mjs",
|
|
172
183
|
"check:boundary": "node scripts/check-boundary.cjs",
|
|
173
184
|
"check:docs-sync": "pnpm --filter @heybox-docs/docs-hb_sdk run check:reference && node scripts/skill/generate-manifest.mjs --check && node scripts/skill/validate-skill.mjs",
|
|
174
185
|
"check:compatibility-evidence": "node scripts/validate-compatibility-evidence.mjs",
|
|
@@ -192,6 +203,9 @@
|
|
|
192
203
|
"release:tag": "node scripts/release-tag.cjs",
|
|
193
204
|
"release:family:dry-run": "node ../../ops/jobs/publish-changed-packages/publish.cjs --dry-run",
|
|
194
205
|
"release:family:promote": "node ../../ops/jobs/publish-changed-packages/publish.cjs --family-action promote",
|
|
195
|
-
"release:family:rollback": "node ../../ops/jobs/publish-changed-packages/publish.cjs --family-action rollback"
|
|
206
|
+
"release:family:rollback": "node ../../ops/jobs/publish-changed-packages/publish.cjs --family-action rollback",
|
|
207
|
+
"check:bundled-contract": "node ../hb-sdk-protocol/scripts/check-bundled-contract.mjs",
|
|
208
|
+
"postbuild:package": "node ../hb-sdk-protocol/scripts/check-bundled-contract.mjs",
|
|
209
|
+
"test:bundled-contract": "node scripts/verify-bundled-consumer.mjs"
|
|
196
210
|
}
|
|
197
211
|
}
|
package/skill/skill.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.9.1-alpha.
|
|
3
|
+
"skillVersion": "0.9.1-alpha.5+skill.aa24d6656331",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.9.1-alpha.
|
|
7
|
-
"compatibility": "0.9.1-alpha.
|
|
6
|
+
"version": "0.9.1-alpha.5",
|
|
7
|
+
"compatibility": "0.9.1-alpha.5"
|
|
8
8
|
},
|
|
9
9
|
"distribution": {
|
|
10
10
|
"type": "npm",
|
|
11
11
|
"package": "@heybox/hb-sdk",
|
|
12
|
-
"version": "0.9.1-alpha.
|
|
12
|
+
"version": "0.9.1-alpha.5",
|
|
13
13
|
"path": "skill"
|
|
14
14
|
},
|
|
15
15
|
"integrity": "sha256-aa24d6656331cbad8f6aae7735258a49d7f1a82f6e900415de53a1b93a30ddb8"
|