@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.
Files changed (36) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cli-chunks/{build-vZ5iT2JO.cjs → build-B3VyxfKr.cjs} +4 -4
  3. package/dist/cli-chunks/{create-DJseFABS.cjs → create-39LGd3Va.cjs} +1 -1
  4. package/dist/cli-chunks/{dev-CsuAVpLX.cjs → dev-B3gKz4BL.cjs} +16785 -15512
  5. package/dist/cli-chunks/{doctor-BYzYg-oP.cjs → doctor-BE6I4-rx.cjs} +1 -1
  6. package/dist/cli-chunks/{game-binding-guide-BfKQ4e83.cjs → game-binding-guide-DDa7jfSf.cjs} +2 -2
  7. package/dist/cli-chunks/{game-bindings-DWOIBCax.cjs → game-bindings-Btsa9s9U.cjs} +3 -3
  8. package/dist/cli-chunks/{games-DmPaqaDd.cjs → games-Dgs1h1U5.cjs} +1 -1
  9. package/dist/cli-chunks/{index-DPEhBPfc.cjs → index-BGtIgSyr.cjs} +1 -1
  10. package/dist/cli-chunks/{index-D5rcGk_z.cjs → index-DdaTdCPN.cjs} +489 -23
  11. package/dist/cli-chunks/{index.esm-DYWovNyE.cjs → index.esm-_pGbNbXF.cjs} +11 -11
  12. package/dist/cli-chunks/{login-o1LQxi8P.cjs → login-Bal-XkCR.cjs} +1 -1
  13. package/dist/cli-chunks/{project-vite-CGIy1XaL.cjs → project-vite-BBF1D8Bo.cjs} +1 -1
  14. package/dist/cli-chunks/{remote-BQ3O-aiB.cjs → remote-pyeuWkyG.cjs} +987 -846
  15. package/dist/cli-chunks/{runtime-permission-env-soFtqTxP.cjs → runtime-permission-env-E7_Ozj6z.cjs} +3 -2
  16. package/dist/cli-chunks/{skill-BHighcnl.cjs → skill-DQze9VfS.cjs} +2 -2
  17. package/dist/cli-chunks/{version-CAh_EBAH.cjs → version-CgVSWQYR.cjs} +1 -1
  18. package/dist/cli.cjs +1 -1
  19. package/dist/devtools/browser-dev-host/assets/browser-dev-host-CRF7uMBi.js +224 -0
  20. package/dist/devtools/browser-dev-host/assets/desktop-app-launch-CRCVNdl9.js +6 -0
  21. package/dist/devtools/browser-dev-host/assets/index-870cPYsT.css +1 -0
  22. package/dist/devtools/browser-dev-host/assets/index-CdokjhK8.js +574 -0
  23. package/dist/devtools/browser-dev-host/assets/pc-onboarding-example-BS3sevnG.webp +0 -0
  24. package/dist/devtools/browser-dev-host/index.html +3 -3
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.esm.js +1 -1
  27. package/dist/vite.cjs.js +16 -8
  28. package/dist/vite.esm.js +16 -8
  29. package/package.json +5 -4
  30. package/skill/SKILL.md +7 -0
  31. package/skill/skill.json +5 -5
  32. package/types/vite/index.d.ts +2 -0
  33. package/dist/devtools/browser-dev-host/assets/browser-dev-host-D9CVFRHE.js +0 -224
  34. package/dist/devtools/browser-dev-host/assets/desktop-app-launch-FZ3iQQs-.js +0 -13
  35. package/dist/devtools/browser-dev-host/assets/index-CVzVitcL.js +0 -567
  36. package/dist/devtools/browser-dev-host/assets/index-D0XGMYIr.css +0 -1
@@ -242,19 +242,19 @@ function requireArgument () {
242
242
 
243
243
  var command = {};
244
244
 
245
- 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-D5rcGk_z.cjs', document.baseURI).href)));
245
+ 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-DdaTdCPN.cjs', document.baseURI).href)));
246
246
  function __require$4() { return require$5("node:events"); }
247
247
 
248
- 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-D5rcGk_z.cjs', document.baseURI).href)));
248
+ 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-DdaTdCPN.cjs', document.baseURI).href)));
249
249
  function __require$3() { return require$4("node:child_process"); }
250
250
 
251
- 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-D5rcGk_z.cjs', document.baseURI).href)));
251
+ 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-DdaTdCPN.cjs', document.baseURI).href)));
252
252
  function __require$2() { return require$3("node:path"); }
253
253
 
254
- 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-D5rcGk_z.cjs', document.baseURI).href)));
254
+ 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-DdaTdCPN.cjs', document.baseURI).href)));
255
255
  function __require$1() { return require$2("node:fs"); }
256
256
 
257
- 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-D5rcGk_z.cjs', document.baseURI).href)));
257
+ 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-DdaTdCPN.cjs', document.baseURI).href)));
258
258
  function __require() { return require$1("node:process"); }
259
259
 
260
260
  var help = {};
@@ -16567,7 +16567,7 @@ var freb = function (eb, start) {
16567
16567
  var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;
16568
16568
  // we can ignore the fact that the other numbers are wrong; they never happen anyway
16569
16569
  fl[28] = 258, revfl[258] = 28;
16570
- var _b = freb(fdeb, 0), fd = _b.b;
16570
+ var _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;
16571
16571
  // map of value to reverse (assuming 16 bits)
16572
16572
  var rev = new u16(32768);
16573
16573
  for (var i = 0; i < 32768; ++i) {
@@ -16644,9 +16644,9 @@ var fdt = new u8(32);
16644
16644
  for (var i = 0; i < 32; ++i)
16645
16645
  fdt[i] = 5;
16646
16646
  // fixed length map
16647
- var flrm = /*#__PURE__*/ hMap(flt, 9, 1);
16647
+ var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);
16648
16648
  // fixed distance map
16649
- var fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);
16649
+ var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);
16650
16650
  // find max of array
16651
16651
  var max = function (a) {
16652
16652
  var m = a[0];
@@ -16886,8 +16886,420 @@ var inflt = function (dat, st, buf, dict) {
16886
16886
  // don't reallocate for streams or user buffers
16887
16887
  return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
16888
16888
  };
16889
+ // starting at p, write the minimum number of bits that can hold v to d
16890
+ var wbits = function (d, p, v) {
16891
+ v <<= p & 7;
16892
+ var o = (p / 8) | 0;
16893
+ d[o] |= v;
16894
+ d[o + 1] |= v >> 8;
16895
+ };
16896
+ // starting at p, write the minimum number of bits (>8) that can hold v to d
16897
+ var wbits16 = function (d, p, v) {
16898
+ v <<= p & 7;
16899
+ var o = (p / 8) | 0;
16900
+ d[o] |= v;
16901
+ d[o + 1] |= v >> 8;
16902
+ d[o + 2] |= v >> 16;
16903
+ };
16904
+ // creates code lengths from a frequency table
16905
+ var hTree = function (d, mb) {
16906
+ // Need extra info to make a tree
16907
+ var t = [];
16908
+ for (var i = 0; i < d.length; ++i) {
16909
+ if (d[i])
16910
+ t.push({ s: i, f: d[i] });
16911
+ }
16912
+ var s = t.length;
16913
+ var t2 = t.slice();
16914
+ if (!s)
16915
+ return { t: et, l: 0 };
16916
+ if (s == 1) {
16917
+ var v = new u8(t[0].s + 1);
16918
+ v[t[0].s] = 1;
16919
+ return { t: v, l: 1 };
16920
+ }
16921
+ t.sort(function (a, b) { return a.f - b.f; });
16922
+ // after i2 reaches last ind, will be stopped
16923
+ // freq must be greater than largest possible number of symbols
16924
+ t.push({ s: -1, f: 25001 });
16925
+ var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;
16926
+ t[0] = { s: -1, f: l.f + r.f, l: l, r: r };
16927
+ // efficient algorithm from UZIP.js
16928
+ // i0 is lookbehind, i2 is lookahead - after processing two low-freq
16929
+ // symbols that combined have high freq, will start processing i2 (high-freq,
16930
+ // non-composite) symbols instead
16931
+ // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/
16932
+ while (i1 != s - 1) {
16933
+ l = t[t[i0].f < t[i2].f ? i0++ : i2++];
16934
+ r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];
16935
+ t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };
16936
+ }
16937
+ var maxSym = t2[0].s;
16938
+ for (var i = 1; i < s; ++i) {
16939
+ if (t2[i].s > maxSym)
16940
+ maxSym = t2[i].s;
16941
+ }
16942
+ // code lengths
16943
+ var tr = new u16(maxSym + 1);
16944
+ // max bits in tree
16945
+ var mbt = ln(t[i1 - 1], tr, 0);
16946
+ if (mbt > mb) {
16947
+ // more algorithms from UZIP.js
16948
+ // TODO: find out how this code works (debt)
16949
+ // ind debt
16950
+ var i = 0, dt = 0;
16951
+ // left cost
16952
+ var lft = mbt - mb, cst = 1 << lft;
16953
+ t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });
16954
+ for (; i < s; ++i) {
16955
+ var i2_1 = t2[i].s;
16956
+ if (tr[i2_1] > mb) {
16957
+ dt += cst - (1 << (mbt - tr[i2_1]));
16958
+ tr[i2_1] = mb;
16959
+ }
16960
+ else
16961
+ break;
16962
+ }
16963
+ dt >>= lft;
16964
+ while (dt > 0) {
16965
+ var i2_2 = t2[i].s;
16966
+ if (tr[i2_2] < mb)
16967
+ dt -= 1 << (mb - tr[i2_2]++ - 1);
16968
+ else
16969
+ ++i;
16970
+ }
16971
+ for (; i >= 0 && dt; --i) {
16972
+ var i2_3 = t2[i].s;
16973
+ if (tr[i2_3] == mb) {
16974
+ --tr[i2_3];
16975
+ ++dt;
16976
+ }
16977
+ }
16978
+ mbt = mb;
16979
+ }
16980
+ return { t: new u8(tr), l: mbt };
16981
+ };
16982
+ // get the max length and assign length codes
16983
+ var ln = function (n, l, d) {
16984
+ return n.s == -1
16985
+ ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))
16986
+ : (l[n.s] = d);
16987
+ };
16988
+ // length codes generation
16989
+ var lc = function (c) {
16990
+ var s = c.length;
16991
+ // Note that the semicolon was intentional
16992
+ while (s && !c[--s])
16993
+ ;
16994
+ var cl = new u16(++s);
16995
+ // ind num streak
16996
+ var cli = 0, cln = c[0], cls = 1;
16997
+ var w = function (v) { cl[cli++] = v; };
16998
+ for (var i = 1; i <= s; ++i) {
16999
+ if (c[i] == cln && i != s)
17000
+ ++cls;
17001
+ else {
17002
+ if (!cln && cls > 2) {
17003
+ for (; cls > 138; cls -= 138)
17004
+ w(32754);
17005
+ if (cls > 2) {
17006
+ w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);
17007
+ cls = 0;
17008
+ }
17009
+ }
17010
+ else if (cls > 3) {
17011
+ w(cln), --cls;
17012
+ for (; cls > 6; cls -= 6)
17013
+ w(8304);
17014
+ if (cls > 2)
17015
+ w(((cls - 3) << 5) | 8208), cls = 0;
17016
+ }
17017
+ while (cls--)
17018
+ w(cln);
17019
+ cls = 1;
17020
+ cln = c[i];
17021
+ }
17022
+ }
17023
+ return { c: cl.subarray(0, cli), n: s };
17024
+ };
17025
+ // calculate the length of output from tree, code lengths
17026
+ var clen = function (cf, cl) {
17027
+ var l = 0;
17028
+ for (var i = 0; i < cl.length; ++i)
17029
+ l += cf[i] * cl[i];
17030
+ return l;
17031
+ };
17032
+ // writes a fixed block
17033
+ // returns the new bit pos
17034
+ var wfblk = function (out, pos, dat) {
17035
+ // no need to write 00 as type: TypedArray defaults to 0
17036
+ var s = dat.length;
17037
+ var o = shft(pos + 2);
17038
+ out[o] = s & 255;
17039
+ out[o + 1] = s >> 8;
17040
+ out[o + 2] = out[o] ^ 255;
17041
+ out[o + 3] = out[o + 1] ^ 255;
17042
+ for (var i = 0; i < s; ++i)
17043
+ out[o + i + 4] = dat[i];
17044
+ return (o + 4 + s) * 8;
17045
+ };
17046
+ // writes a block
17047
+ var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
17048
+ wbits(out, p++, final);
17049
+ ++lf[256];
17050
+ var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;
17051
+ var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;
17052
+ var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
17053
+ var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
17054
+ var lcfreq = new u16(19);
17055
+ for (var i = 0; i < lclt.length; ++i)
17056
+ ++lcfreq[lclt[i] & 31];
17057
+ for (var i = 0; i < lcdt.length; ++i)
17058
+ ++lcfreq[lcdt[i] & 31];
17059
+ var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
17060
+ var nlcc = 19;
17061
+ for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
17062
+ ;
17063
+ var flen = (bl + 5) << 3;
17064
+ var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
17065
+ var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
17066
+ if (bs >= 0 && flen <= ftlen && flen <= dtlen)
17067
+ return wfblk(out, p, dat.subarray(bs, bs + bl));
17068
+ var lm, ll, dm, dl;
17069
+ wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
17070
+ if (dtlen < ftlen) {
17071
+ lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
17072
+ var llm = hMap(lct, mlcb, 0);
17073
+ wbits(out, p, nlc - 257);
17074
+ wbits(out, p + 5, ndc - 1);
17075
+ wbits(out, p + 10, nlcc - 4);
17076
+ p += 14;
17077
+ for (var i = 0; i < nlcc; ++i)
17078
+ wbits(out, p + 3 * i, lct[clim[i]]);
17079
+ p += 3 * nlcc;
17080
+ var lcts = [lclt, lcdt];
17081
+ for (var it = 0; it < 2; ++it) {
17082
+ var clct = lcts[it];
17083
+ for (var i = 0; i < clct.length; ++i) {
17084
+ var len = clct[i] & 31;
17085
+ wbits(out, p, llm[len]), p += lct[len];
17086
+ if (len > 15)
17087
+ wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;
17088
+ }
17089
+ }
17090
+ }
17091
+ else {
17092
+ lm = flm, ll = flt, dm = fdm, dl = fdt;
17093
+ }
17094
+ for (var i = 0; i < li; ++i) {
17095
+ var sym = syms[i];
17096
+ if (sym > 255) {
17097
+ var len = (sym >> 18) & 31;
17098
+ wbits16(out, p, lm[len + 257]), p += ll[len + 257];
17099
+ if (len > 7)
17100
+ wbits(out, p, (sym >> 23) & 31), p += fleb[len];
17101
+ var dst = sym & 31;
17102
+ wbits16(out, p, dm[dst]), p += dl[dst];
17103
+ if (dst > 3)
17104
+ wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];
17105
+ }
17106
+ else {
17107
+ wbits16(out, p, lm[sym]), p += ll[sym];
17108
+ }
17109
+ }
17110
+ wbits16(out, p, lm[256]);
17111
+ return p + ll[256];
17112
+ };
17113
+ // deflate options (nice << 13) | chain
17114
+ var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
16889
17115
  // empty
16890
17116
  var et = /*#__PURE__*/ new u8(0);
17117
+ // compresses data into a raw DEFLATE buffer
17118
+ var dflt = function (dat, lvl, plvl, pre, post, st) {
17119
+ var s = st.z || dat.length;
17120
+ var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
17121
+ // writing to this writes to the output buffer
17122
+ var w = o.subarray(pre, o.length - post);
17123
+ var lst = st.l;
17124
+ var pos = (st.r || 0) & 7;
17125
+ if (lvl) {
17126
+ if (pos)
17127
+ w[0] = st.r >> 3;
17128
+ var opt = deo[lvl - 1];
17129
+ var n = opt >> 13, c = opt & 8191;
17130
+ var msk_1 = (1 << plvl) - 1;
17131
+ // prev 2-byte val map curr 2-byte val map
17132
+ var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
17133
+ var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
17134
+ var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };
17135
+ // 24576 is an arbitrary number of maximum symbols per block
17136
+ // 424 buffer for last block
17137
+ var syms = new i32(25000);
17138
+ // length/literal freq distance freq
17139
+ var lf = new u16(288), df = new u16(32);
17140
+ // l/lcnt exbits index l/lind waitdx blkpos
17141
+ var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
17142
+ for (; i + 2 < s; ++i) {
17143
+ // hash value
17144
+ var hv = hsh(i);
17145
+ // index mod 32768 previous index mod
17146
+ var imod = i & 32767, pimod = head[hv];
17147
+ prev[imod] = pimod;
17148
+ head[hv] = imod;
17149
+ // We always should modify head and prev, but only add symbols if
17150
+ // this data is not yet processed ("wait" for wait index)
17151
+ if (wi <= i) {
17152
+ // bytes remaining
17153
+ var rem = s - i;
17154
+ if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
17155
+ pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);
17156
+ li = lc_1 = eb = 0, bs = i;
17157
+ for (var j = 0; j < 286; ++j)
17158
+ lf[j] = 0;
17159
+ for (var j = 0; j < 30; ++j)
17160
+ df[j] = 0;
17161
+ }
17162
+ // len dist chain
17163
+ var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
17164
+ if (rem > 2 && hv == hsh(i - dif)) {
17165
+ var maxn = Math.min(n, rem) - 1;
17166
+ var maxd = Math.min(32767, i);
17167
+ // max possible length
17168
+ // not capped at dif because decompressors implement "rolling" index population
17169
+ var ml = Math.min(258, rem);
17170
+ while (dif <= maxd && --ch_1 && imod != pimod) {
17171
+ if (dat[i + l] == dat[i + l - dif]) {
17172
+ var nl = 0;
17173
+ for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)
17174
+ ;
17175
+ if (nl > l) {
17176
+ l = nl, d = dif;
17177
+ // break out early when we reach "nice" (we are satisfied enough)
17178
+ if (nl > maxn)
17179
+ break;
17180
+ // now, find the rarest 2-byte sequence within this
17181
+ // length of literals and search for that instead.
17182
+ // Much faster than just using the start
17183
+ var mmd = Math.min(dif, nl - 2);
17184
+ var md = 0;
17185
+ for (var j = 0; j < mmd; ++j) {
17186
+ var ti = i - dif + j & 32767;
17187
+ var pti = prev[ti];
17188
+ var cd = ti - pti & 32767;
17189
+ if (cd > md)
17190
+ md = cd, pimod = ti;
17191
+ }
17192
+ }
17193
+ }
17194
+ // check the previous match
17195
+ imod = pimod, pimod = prev[imod];
17196
+ dif += imod - pimod & 32767;
17197
+ }
17198
+ }
17199
+ // d will be nonzero only when a match was found
17200
+ if (d) {
17201
+ // store both dist and len data in one int32
17202
+ // Make sure this is recognized as a len/dist with 28th bit (2^28)
17203
+ syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];
17204
+ var lin = revfl[l] & 31, din = revfd[d] & 31;
17205
+ eb += fleb[lin] + fdeb[din];
17206
+ ++lf[257 + lin];
17207
+ ++df[din];
17208
+ wi = i + l;
17209
+ ++lc_1;
17210
+ }
17211
+ else {
17212
+ syms[li++] = dat[i];
17213
+ ++lf[dat[i]];
17214
+ }
17215
+ }
17216
+ }
17217
+ for (i = Math.max(i, wi); i < s; ++i) {
17218
+ syms[li++] = dat[i];
17219
+ ++lf[dat[i]];
17220
+ }
17221
+ pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);
17222
+ if (!lst) {
17223
+ st.r = (pos & 7) | w[(pos / 8) | 0] << 3;
17224
+ // shft(pos) now 1 less if pos & 7 != 0
17225
+ pos -= 7;
17226
+ st.h = head, st.p = prev, st.i = i, st.w = wi;
17227
+ }
17228
+ }
17229
+ else {
17230
+ for (var i = st.w || 0; i < s + lst; i += 65535) {
17231
+ // end
17232
+ var e = i + 65535;
17233
+ if (e >= s) {
17234
+ // write final block
17235
+ w[(pos / 8) | 0] = lst;
17236
+ e = s;
17237
+ }
17238
+ pos = wfblk(w, pos + 1, dat.subarray(i, e));
17239
+ }
17240
+ st.i = s;
17241
+ }
17242
+ return slc(o, 0, pre + shft(pos) + post);
17243
+ };
17244
+ // CRC32 table
17245
+ var crct = /*#__PURE__*/ (function () {
17246
+ var t = new Int32Array(256);
17247
+ for (var i = 0; i < 256; ++i) {
17248
+ var c = i, k = 9;
17249
+ while (--k)
17250
+ c = ((c & 1) && -306674912) ^ (c >>> 1);
17251
+ t[i] = c;
17252
+ }
17253
+ return t;
17254
+ })();
17255
+ // CRC32
17256
+ var crc = function () {
17257
+ var c = -1;
17258
+ return {
17259
+ p: function (d) {
17260
+ // closures have awful performance
17261
+ var cr = c;
17262
+ for (var i = 0; i < d.length; ++i)
17263
+ cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);
17264
+ c = cr;
17265
+ },
17266
+ d: function () { return ~c; }
17267
+ };
17268
+ };
17269
+ // deflate with opts
17270
+ var dopt = function (dat, opt, pre, post, st) {
17271
+ if (!st) {
17272
+ st = { l: 1 };
17273
+ if (opt.dictionary) {
17274
+ var dict = opt.dictionary.subarray(-32768);
17275
+ var newDat = new u8(dict.length + dat.length);
17276
+ newDat.set(dict);
17277
+ newDat.set(dat, dict.length);
17278
+ dat = newDat;
17279
+ st.w = dict.length;
17280
+ }
17281
+ }
17282
+ return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st);
17283
+ };
17284
+ // write bytes
17285
+ var wbytes = function (d, b, v) {
17286
+ for (; v; ++b)
17287
+ d[b] = v, v >>>= 8;
17288
+ };
17289
+ // gzip header
17290
+ var gzh = function (c, o) {
17291
+ var fn = o.filename;
17292
+ c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix
17293
+ if (o.mtime != 0)
17294
+ wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));
17295
+ if (fn) {
17296
+ c[3] = 8;
17297
+ for (var i = 0; i <= fn.length; ++i)
17298
+ c[i + 10] = fn.charCodeAt(i);
17299
+ }
17300
+ };
17301
+ // gzip header length
17302
+ var gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };
16891
17303
  /**
16892
17304
  * Streaming DEFLATE decompression
16893
17305
  */
@@ -16934,6 +17346,20 @@ var Inflate = /*#__PURE__*/ (function () {
16934
17346
  };
16935
17347
  return Inflate;
16936
17348
  }());
17349
+ /**
17350
+ * Compresses data with GZIP
17351
+ * @param data The data to compress
17352
+ * @param opts The compression options
17353
+ * @returns The gzipped version of the data
17354
+ */
17355
+ function gzipSync(data, opts) {
17356
+ if (!opts)
17357
+ opts = {};
17358
+ var c = crc(), l = data.length;
17359
+ c.p(data);
17360
+ var d = dopt(data, opts, gzhl(opts), 8), s = d.length;
17361
+ return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;
17362
+ }
16937
17363
  // text decoder
16938
17364
  var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();
16939
17365
  // text decoder stream
@@ -17253,7 +17679,7 @@ async function inspectFeedbackLog(file, size) {
17253
17679
  return { mimeType: 'text/plain', width: 0, height: 0 };
17254
17680
  }
17255
17681
  async function createFeedbackCosClient(getToken) {
17256
- const { default: COS } = await Promise.resolve().then(function () { return require('./index-DPEhBPfc.cjs'); }).then(function (n) { return n.index; });
17682
+ const { default: COS } = await Promise.resolve().then(function () { return require('./index-BGtIgSyr.cjs'); }).then(function (n) { return n.index; });
17257
17683
  const cos = new COS({
17258
17684
  getAuthorization(_options, callback) {
17259
17685
  void getToken().then((token) => callback({
@@ -20357,6 +20783,9 @@ function installFeedbackCommand(program, runtime = {}) {
20357
20783
  installFeedbackTicketCommands(command, runtime);
20358
20784
  }
20359
20785
 
20786
+ /** 手机上传预览与正式发布独立;本合同不暴露上传凭据。 */
20787
+ const DEV_MOBILE_PREVIEW_PATH = '/__hb_sdk__/mobile-preview';
20788
+
20360
20789
  /** CLI 与 Node 连接入口共用项目定位;不加载 Vite、终端交互或日志组件。 */
20361
20790
  function findProjectRoot(startDir) {
20362
20791
  let current = path.resolve(startDir);
@@ -21654,6 +22083,32 @@ function delay(ms, signal) {
21654
22083
  function installDevToolCommands(dev) {
21655
22084
  dev.enablePositionalOptions();
21656
22085
  dev.parent?.enablePositionalOptions();
22086
+ dev
22087
+ .command('sync')
22088
+ .description('构建并上传手机预览,成功后重新扫码打开快照')
22089
+ .option('--port <port>', '显式指定调试台;默认发现当前项目')
22090
+ .action(async (options, command) => {
22091
+ const connection = await connectCurrentDevHost(readDevToolPort(command, options.port));
22092
+ let task = await requestDevHost(connection, DEV_MOBILE_PREVIEW_PATH, { method: 'POST' });
22093
+ const taskId = task.taskId;
22094
+ const deadline = Date.now() + 30 * 60_000;
22095
+ let message;
22096
+ while (!['succeeded', 'failed', 'cancelled'].includes(String(task.phase))) {
22097
+ if (task.message !== message) {
22098
+ process.stderr.write(String(task.message) + '\n');
22099
+ message = task.message;
22100
+ }
22101
+ if (Date.now() > deadline)
22102
+ throw new Error('同步等待超时,任务可能仍在运行,请用 dev inspect 查看');
22103
+ await new Promise((resolve) => setTimeout(resolve, 1000));
22104
+ task = await requestDevHost(connection, DEV_MOBILE_PREVIEW_PATH);
22105
+ if (task.taskId !== taskId)
22106
+ throw new Error('同步任务已变化,请用 dev inspect 查看');
22107
+ }
22108
+ writeDevResult(task);
22109
+ if (task.phase !== 'succeeded')
22110
+ throw new Error(String(task.message || '手机同步失败'));
22111
+ });
21657
22112
  dev
21658
22113
  .command('list')
21659
22114
  .description('列出当前用户启动的本机开发服务')
@@ -21935,7 +22390,7 @@ function installDevPreviewCommands(dev) {
21935
22390
  }
21936
22391
 
21937
22392
  const CLI_VERSION_PLACEHOLDER = ['__HB', 'SDK', 'CLI', 'VERSION__'].join('_');
21938
- const BUILT_CLI_VERSION = '0.9.9-alpha.1';
22393
+ const BUILT_CLI_VERSION = '0.9.9-alpha.12';
21939
22394
  const PACKAGE_JSON_CANDIDATES$1 = [
21940
22395
  path.resolve(__dirname, '..', '..', 'package.json'),
21941
22396
  path.resolve(__dirname, '..', 'package.json'),
@@ -23181,10 +23636,18 @@ function installRemoteCommands(program, handlers, resolveLogger) {
23181
23636
  addRemotePublicOptions(remote.command('info').description('查看当前绑定的远程工坊小程序详情')).action(createRemoteAction(handlers, resolveLogger, 'info'));
23182
23637
  const post = addRemotePublicOptions(remote.command('post').description('管理小程序关联帖子;每个小程序最多关联一篇自己的公开帖子'));
23183
23638
  addRemotePublicOptions(post.command('get').description('查看当前关联帖子')).action(createRemoteAction(handlers, resolveLogger, 'post:get'));
23184
- addRemotePublicOptions(post.command('preview').description('校验并预览待关联的帖子').argument('<post-id>', '帖子 ID')).action(createRemoteAction(handlers, resolveLogger, 'post:preview', (_command, postId) => ({
23639
+ addRemotePublicOptions(post
23640
+ .command('preview')
23641
+ .addHelpText('after', '\n使用帖子链接时,请用英文双引号包裹完整链接,避免 & 被 shell 解析。\n示例\n npm exec hb-sdk -- remote post preview "https://api.xiaoheihe.cn/v3/bbs/app/api/web/share?link_id=43ef72d469fb&h_src=app"\n请直接复制 URL,不要包含 Markdown 的 [文字](链接) 格式。')
23642
+ .description('校验并预览待关联的帖子')
23643
+ .argument('<post-id-or-url>', '帖子 ID 或小黑盒帖子链接,链接必须用英文双引号包裹')).action(createRemoteAction(handlers, resolveLogger, 'post:preview', (_command, postId) => ({
23185
23644
  postId: readStringArgument(postId, 'post-id'),
23186
23645
  })));
23187
- addRemotePublicOptions(post.command('bind').description('关联或更换帖子').argument('<post-id>', '帖子 ID')).action(createRemoteAction(handlers, resolveLogger, 'post:bind', (_command, postId) => ({
23646
+ addRemotePublicOptions(post
23647
+ .command('bind')
23648
+ .addHelpText('after', '\n使用帖子链接时,请用英文双引号包裹完整链接,避免 & 被 shell 解析。\n示例\n npm exec hb-sdk -- remote post bind "https://api.xiaoheihe.cn/v3/bbs/app/api/web/share?link_id=43ef72d469fb&h_src=app"\n请直接复制 URL,不要包含 Markdown 的 [文字](链接) 格式。')
23649
+ .description('关联或更换帖子')
23650
+ .argument('<post-id-or-url>', '帖子 ID 或小黑盒帖子链接,链接必须用英文双引号包裹')).action(createRemoteAction(handlers, resolveLogger, 'post:bind', (_command, postId) => ({
23188
23651
  postId: readStringArgument(postId, 'post-id'),
23189
23652
  })));
23190
23653
  addRemotePublicOptions(post.command('unbind').description('解除当前帖子关联')).action(createRemoteAction(handlers, resolveLogger, 'post:unbind'));
@@ -23373,39 +23836,39 @@ function createCommandLoggerResolver(options) {
23373
23836
  };
23374
23837
  }
23375
23838
  const defaultClearLoginStatus = async (...args) => {
23376
- const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-o1LQxi8P.cjs'); });
23839
+ const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-Bal-XkCR.cjs'); });
23377
23840
  return clearLoginStatus(...args);
23378
23841
  };
23379
23842
  const defaultLoginToHeybox = async (...args) => {
23380
- const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-o1LQxi8P.cjs'); });
23843
+ const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-Bal-XkCR.cjs'); });
23381
23844
  return loginToHeybox(...args);
23382
23845
  };
23383
23846
  const defaultPrintLoginStatus = async (...args) => {
23384
- const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-o1LQxi8P.cjs'); });
23847
+ const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-Bal-XkCR.cjs'); });
23385
23848
  return printLoginStatus(...args);
23386
23849
  };
23387
23850
  const defaultRunBuildCommand = async (...args) => {
23388
- const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-vZ5iT2JO.cjs'); });
23851
+ const { runBuildCommand } = await Promise.resolve().then(function () { return require('./build-B3VyxfKr.cjs'); });
23389
23852
  return runBuildCommand(...args);
23390
23853
  };
23391
23854
  const defaultRunCreateCommand = async (...args) => {
23392
- const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-DJseFABS.cjs'); });
23855
+ const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-39LGd3Va.cjs'); });
23393
23856
  return runCreateCommand(...args);
23394
23857
  };
23395
23858
  const defaultRunDevCommand = async (...args) => {
23396
- const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-CsuAVpLX.cjs'); }).then(function (n) { return n.dev; });
23859
+ const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-B3gKz4BL.cjs'); }).then(function (n) { return n.dev; });
23397
23860
  return runDevCommand(...args);
23398
23861
  };
23399
23862
  const defaultRunDoctorCommand = async (...args) => {
23400
- const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-BYzYg-oP.cjs'); });
23863
+ const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-BE6I4-rx.cjs'); });
23401
23864
  return runDoctorCommand(...args);
23402
23865
  };
23403
23866
  const defaultRunSkillInstallCommand = async (...args) => {
23404
- const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-BHighcnl.cjs'); });
23867
+ const { runSkillInstallCommand } = await Promise.resolve().then(function () { return require('./skill-DQze9VfS.cjs'); });
23405
23868
  return runSkillInstallCommand(...args);
23406
23869
  };
23407
23870
  const defaultRunRemoteCommand = async (...args) => {
23408
- const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-BQ3O-aiB.cjs'); }).then(function (n) { return n.remote; });
23871
+ const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-pyeuWkyG.cjs'); }).then(function (n) { return n.remote; });
23409
23872
  return runRemoteCommand(...args);
23410
23873
  };
23411
23874
  function resolveStandaloneLogger(options, verbose) {
@@ -23531,11 +23994,11 @@ function parseNonNegativeInteger(value) {
23531
23994
  return parsed;
23532
23995
  }
23533
23996
  const defaultRunGameSearchCommand = async (...args) => {
23534
- const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-DmPaqaDd.cjs'); });
23997
+ const { runGameSearchCommand } = await Promise.resolve().then(function () { return require('./games-Dgs1h1U5.cjs'); });
23535
23998
  return runGameSearchCommand(...args);
23536
23999
  };
23537
24000
  const defaultRunConfigureGameBindingsCommand = async (...args) => {
23538
- const { runConfigureGameBindingsCommand } = await Promise.resolve().then(function () { return require('./game-bindings-DWOIBCax.cjs'); });
24001
+ const { runConfigureGameBindingsCommand } = await Promise.resolve().then(function () { return require('./game-bindings-Btsa9s9U.cjs'); });
23539
24002
  return runConfigureGameBindingsCommand(...args);
23540
24003
  };
23541
24004
 
@@ -23546,6 +24009,7 @@ exports.DESKTOP_DEVICE_ID = DESKTOP_DEVICE_ID;
23546
24009
  exports.DEVICE_PRESETS = DEVICE_PRESETS;
23547
24010
  exports.DEV_DIAGNOSTICS_PATH = DEV_DIAGNOSTICS_PATH;
23548
24011
  exports.DEV_DIAGNOSTICS_SCHEMA_VERSION = DEV_DIAGNOSTICS_SCHEMA_VERSION;
24012
+ exports.DEV_MOBILE_PREVIEW_PATH = DEV_MOBILE_PREVIEW_PATH;
23549
24013
  exports.DEV_PRESENTATION_MAX_INTERACTIONS = DEV_PRESENTATION_MAX_INTERACTIONS;
23550
24014
  exports.DEV_RESOURCE_PATH = DEV_RESOURCE_PATH;
23551
24015
  exports.DEV_SANDBOX_READ_MAX_BYTES = DEV_SANDBOX_READ_MAX_BYTES;
@@ -23566,6 +24030,7 @@ exports.createCliRateLimitedErrorFromState = createCliRateLimitedErrorFromState;
23566
24030
  exports.createHeyboxApiUrl = createHeyboxApiUrl;
23567
24031
  exports.createHeyboxAuthSession = createHeyboxAuthSession;
23568
24032
  exports.createHeyboxOpenPlatformRequestContext = createHeyboxOpenPlatformRequestContext;
24033
+ exports.createHeyboxRequestContext = createHeyboxRequestContext;
23569
24034
  exports.createSkillContentHash = createSkillContentHash;
23570
24035
  exports.envPaths = envPaths;
23571
24036
  exports.findPreviewPage = findPreviewPage;
@@ -23576,6 +24041,7 @@ exports.getCDNUploadInfo = getCDNUploadInfo;
23576
24041
  exports.getCDNUploadToken = getCDNUploadToken;
23577
24042
  exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
23578
24043
  exports.getPreviewPlaywrightStatus = getPreviewPlaywrightStatus;
24044
+ exports.gzipSync = gzipSync;
23579
24045
  exports.isPreviewDocumentUrl = isPreviewDocumentUrl;
23580
24046
  exports.isProcessUsingProfile = isProcessUsingProfile;
23581
24047
  exports.isRecord = isRecord$1;