@bounded-sh/client 0.0.53 → 0.0.56

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 (52) hide show
  1. package/dist/builds/apps.d.ts +22 -0
  2. package/dist/{email-auth-provider-BZJ9EcnE.js → email-auth-provider-4Df8dFOh.js} +2 -2
  3. package/dist/{email-auth-provider-BZJ9EcnE.js.map → email-auth-provider-4Df8dFOh.js.map} +1 -1
  4. package/dist/{email-auth-provider-BGc8H93l.mjs → email-auth-provider-BqX-o_sJ.mjs} +2 -2
  5. package/dist/{email-auth-provider-CD7YIGxe.mjs.map → email-auth-provider-BqX-o_sJ.mjs.map} +1 -1
  6. package/dist/{email-auth-provider-CD7YIGxe.mjs → email-auth-provider-By6SL0YS.mjs} +2 -2
  7. package/dist/{email-auth-provider-BGc8H93l.mjs.map → email-auth-provider-By6SL0YS.mjs.map} +1 -1
  8. package/dist/{email-auth-provider-ChDGkDyY.js → email-auth-provider-CZ-xYVln.js} +2 -2
  9. package/dist/{email-auth-provider-ChDGkDyY.js.map → email-auth-provider-CZ-xYVln.js.map} +1 -1
  10. package/dist/{guest-auth-provider-BkkSRli_.mjs → guest-auth-provider-6bqnyX79.mjs} +2 -2
  11. package/dist/{guest-auth-provider-DZQWJu59.mjs.map → guest-auth-provider-6bqnyX79.mjs.map} +1 -1
  12. package/dist/{guest-auth-provider-C7u3RFEX.js → guest-auth-provider-D9A4SU4z.js} +2 -2
  13. package/dist/{guest-auth-provider-C7u3RFEX.js.map → guest-auth-provider-D9A4SU4z.js.map} +1 -1
  14. package/dist/{guest-auth-provider-B2CPHhym.js → guest-auth-provider-DWcdRvLW.js} +2 -2
  15. package/dist/{guest-auth-provider-B2CPHhym.js.map → guest-auth-provider-DWcdRvLW.js.map} +1 -1
  16. package/dist/{guest-auth-provider-DZQWJu59.mjs → guest-auth-provider-Q2wbjdHM.mjs} +2 -2
  17. package/dist/{guest-auth-provider-BkkSRli_.mjs.map → guest-auth-provider-Q2wbjdHM.mjs.map} +1 -1
  18. package/dist/{index-DuaMs1q-.mjs → index--jrXqxte.mjs} +45 -10
  19. package/dist/index--jrXqxte.mjs.map +1 -0
  20. package/dist/{index-CK36YlGT.js → index-B_uRc6gn.js} +45 -10
  21. package/dist/index-B_uRc6gn.js.map +1 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.js +9 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +2 -2
  26. package/dist/{index.native-DoWvYWaz.js → index.native-BqK-14S8.js} +45 -10
  27. package/dist/{index.native-DoWvYWaz.js.map → index.native-BqK-14S8.js.map} +1 -1
  28. package/dist/{index.native-C5SoJAZn.mjs → index.native-CTVEq0VY.mjs} +45 -10
  29. package/dist/{index.native-C5SoJAZn.mjs.map → index.native-CTVEq0VY.mjs.map} +1 -1
  30. package/dist/index.native.d.ts +2 -0
  31. package/dist/index.native.js +9 -1
  32. package/dist/index.native.js.map +1 -1
  33. package/dist/index.native.mjs +2 -2
  34. package/dist/{injected-evm-wallet-provider-CMZE-rJ7.mjs → injected-evm-wallet-provider-BCR37kRN.mjs} +2 -2
  35. package/dist/{injected-evm-wallet-provider-CMZE-rJ7.mjs.map → injected-evm-wallet-provider-BCR37kRN.mjs.map} +1 -1
  36. package/dist/{injected-evm-wallet-provider-bbFMPrsJ.mjs → injected-evm-wallet-provider-BZPmj8bC.mjs} +2 -2
  37. package/dist/{injected-evm-wallet-provider-bbFMPrsJ.mjs.map → injected-evm-wallet-provider-BZPmj8bC.mjs.map} +1 -1
  38. package/dist/{injected-evm-wallet-provider-9ephHduG.js → injected-evm-wallet-provider-CXfQT5sm.js} +2 -2
  39. package/dist/{injected-evm-wallet-provider-9ephHduG.js.map → injected-evm-wallet-provider-CXfQT5sm.js.map} +1 -1
  40. package/dist/{injected-evm-wallet-provider-GANZNy2j.js → injected-evm-wallet-provider-xZ01LIw2.js} +2 -2
  41. package/dist/{injected-evm-wallet-provider-GANZNy2j.js.map → injected-evm-wallet-provider-xZ01LIw2.js.map} +1 -1
  42. package/dist/{injected-wallet-provider-BHBiq-r2.mjs → injected-wallet-provider-1IRUHyB3.mjs} +2 -2
  43. package/dist/{injected-wallet-provider-BHBiq-r2.mjs.map → injected-wallet-provider-1IRUHyB3.mjs.map} +1 -1
  44. package/dist/{injected-wallet-provider-CABVyh7K.js → injected-wallet-provider-ClI_h_fy.js} +2 -2
  45. package/dist/{injected-wallet-provider-CABVyh7K.js.map → injected-wallet-provider-ClI_h_fy.js.map} +1 -1
  46. package/dist/{injected-wallet-provider-DGN0kuf_.mjs → injected-wallet-provider-DHQGI0Yl.mjs} +2 -2
  47. package/dist/{injected-wallet-provider-DGN0kuf_.mjs.map → injected-wallet-provider-DHQGI0Yl.mjs.map} +1 -1
  48. package/dist/{injected-wallet-provider-C_EmEki7.js → injected-wallet-provider-eMZ8tjas.js} +2 -2
  49. package/dist/{injected-wallet-provider-C_EmEki7.js.map → injected-wallet-provider-eMZ8tjas.js.map} +1 -1
  50. package/package.json +2 -2
  51. package/dist/index-CK36YlGT.js.map +0 -1
  52. package/dist/index-DuaMs1q-.mjs.map +0 -1
@@ -4464,7 +4464,7 @@ async function getAuthProvider(config) {
4464
4464
  // manager as legacy email sessions. Human login should be started
4465
4465
  // with loginWithRedirect(); this provider is kept as the restore and
4466
4466
  // logout surface for those sessions.
4467
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-BZJ9EcnE.js'); })).EmailAuthProvider();
4467
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-4Df8dFOh.js'); })).EmailAuthProvider();
4468
4468
  break;
4469
4469
  case "wallet":
4470
4470
  case "phantom": {
@@ -4483,7 +4483,7 @@ async function getAuthProvider(config) {
4483
4483
  if (!isWalletLoginEnabled(config)) {
4484
4484
  throw walletLoginNotEnabledError(authMethod);
4485
4485
  }
4486
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-CABVyh7K.js'); });
4486
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-ClI_h_fy.js'); });
4487
4487
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
4488
4488
  break;
4489
4489
  }
@@ -4496,7 +4496,7 @@ async function getAuthProvider(config) {
4496
4496
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
4497
4497
  // to point at a specific wallet or set chainId/domain.
4498
4498
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
4499
- const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-GANZNy2j.js'); });
4499
+ const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-xZ01LIw2.js'); });
4500
4500
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
4501
4501
  break;
4502
4502
  }
@@ -4524,7 +4524,7 @@ async function getAuthProvider(config) {
4524
4524
  break;
4525
4525
  case "guest":
4526
4526
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
4527
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-B2CPHhym.js'); })).GuestAuthProvider();
4527
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DWcdRvLW.js'); })).GuestAuthProvider();
4528
4528
  break;
4529
4529
  }
4530
4530
  if (!currentAuthProvider) {
@@ -4580,7 +4580,7 @@ async function signInAnonymously() {
4580
4580
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
4581
4581
  // the main bundle for data-only apps. Specifier is a static string literal
4582
4582
  // so bundle-splitting can see it.
4583
- const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-B2CPHhym.js'); })).GuestAuthProvider();
4583
+ const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DWcdRvLW.js'); })).GuestAuthProvider();
4584
4584
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
4585
4585
  const commit = (user) => {
4586
4586
  // No await/interleaving inside this block: provider/method/config/marker
@@ -5442,9 +5442,11 @@ const BUILD_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-review-capability.v1';
5442
5442
  const BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = 'bounded.build-review-capability-refresh.v1';
5443
5443
  const BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-delegated-review-capability.v1';
5444
5444
 
5445
+ const FAST_POLL_MS = 1000;
5445
5446
  const NORMAL_POLL_MS = 2000;
5446
5447
  const PARKED_POLL_MS = 5000;
5447
5448
  const LONG_RUNNING_POLL_MS = 10000;
5449
+ const THIRTY_SECONDS_MS = 30000;
5448
5450
  const TWO_MINUTES_MS = 2 * 60000;
5449
5451
  const TEN_MINUTES_MS = 10 * 60000;
5450
5452
  const terminalStates = new Set(TERMINAL_STATES);
@@ -5453,6 +5455,10 @@ function pollCadence(state, elapsedMs) {
5453
5455
  return LONG_RUNNING_POLL_MS;
5454
5456
  if ((state === null || state === void 0 ? void 0 : state.startsWith('parked')) || elapsedMs >= TWO_MINUTES_MS)
5455
5457
  return PARKED_POLL_MS;
5458
+ // The first 30s is where the user is staring at "waiting for a build slot" /
5459
+ // "building" and every transition matters most; poll fast, then relax.
5460
+ if (elapsedMs < THIRTY_SECONDS_MS)
5461
+ return FAST_POLL_MS;
5456
5462
  return NORMAL_POLL_MS;
5457
5463
  }
5458
5464
  function retryCadence(error, state, elapsedMs) {
@@ -5538,9 +5544,18 @@ function watch(appId, runId, onUpdate, options = {}) {
5538
5544
  const poll = async () => {
5539
5545
  if (!active)
5540
5546
  return;
5547
+ // Fire the view and the events page concurrently: the events cursor (lastSeq)
5548
+ // does not depend on the run view, so there is no reason to pay two serial
5549
+ // round-trips per tick. Error semantics below are unchanged — the run result
5550
+ // still gates, and a failed events page still publishes the run with no rows.
5551
+ const runPromise = get(appId, runId);
5552
+ const eventsPromise = events(appId, runId, lastSeq);
5553
+ // Keep the in-flight events page from becoming an unhandled rejection if the
5554
+ // run result makes us bail before awaiting it; the real await below still sees it.
5555
+ eventsPromise.catch(() => { });
5541
5556
  let run;
5542
5557
  try {
5543
- const view = await get(appId, runId);
5558
+ const view = await runPromise;
5544
5559
  if (!active)
5545
5560
  return;
5546
5561
  run = view.run;
@@ -5558,7 +5573,7 @@ function watch(appId, runId, onUpdate, options = {}) {
5558
5573
  return;
5559
5574
  }
5560
5575
  try {
5561
- const response = await events(appId, runId, lastSeq);
5576
+ const response = await eventsPromise;
5562
5577
  if (!active)
5563
5578
  return;
5564
5579
  const deduped = newEvents(Array.isArray(response.events) ? response.events : [], lastSeq, seenSeqs);
@@ -5700,7 +5715,27 @@ async function create(options = {}) {
5700
5715
  method: 'POST',
5701
5716
  body,
5702
5717
  });
5703
- return Object.assign(Object.assign({ appId: app.appId }, (typeof app.slug === 'string' && app.slug ? { slug: app.slug } : {})), { url: app.url });
5718
+ return Object.assign(Object.assign(Object.assign(Object.assign({ appId: app.appId }, (typeof app.slug === 'string' && app.slug ? { slug: app.slug } : {})), { url: app.url }), (typeof app.prompt === 'string' && app.prompt ? { prompt: app.prompt } : {})), (typeof app.handoff === 'string' && app.handoff ? { handoff: app.handoff } : {}));
5719
+ }
5720
+ /**
5721
+ * F-1200: build the create-flow redirect the owner is sent to after `create()`, with the
5722
+ * prompt and handoff carried in the URL FRAGMENT (never the query - fragments never reach
5723
+ * servers, logs, or Referer). Encoding is byte-exact so the widget's `URLSearchParams`
5724
+ * parse + `.trim()` reproduces the SAME prompt string dev-api hashed into the handoff;
5725
+ * getting this wrong would make the widget reject a genuine token and degrade to prefill.
5726
+ * Callers (bounded.sh, oapps.fun) should use this instead of hand-building the URL.
5727
+ *
5728
+ * Returns `${url}#bounded_prompt=<prompt>` with no `&bounded_handoff=` when the server
5729
+ * minted no handoff (HANDOFF_SECRET unset) - the widget then prefills without auto-running.
5730
+ */
5731
+ function buildCreateRedirectUrl(app) {
5732
+ const base = app.url;
5733
+ const prompt = typeof app.prompt === 'string' ? app.prompt.trim() : '';
5734
+ if (!prompt)
5735
+ return base;
5736
+ const params = `bounded_prompt=${encodeURIComponent(prompt)}`
5737
+ + (app.handoff ? `&bounded_handoff=${encodeURIComponent(app.handoff)}` : '');
5738
+ return `${base}#${params}`;
5704
5739
  }
5705
5740
  async function list() {
5706
5741
  // This legacy-compatible action shape is also used by oapps.fun listMyApps.
@@ -5733,7 +5768,7 @@ async function list() {
5733
5768
  * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost) —
5734
5769
  * dev-api CORS blocks calls from generated-app origins. Server-side callers unaffected.
5735
5770
  */
5736
- const apps = { create, list };
5771
+ const apps = { create, list, buildCreateRedirectUrl };
5737
5772
 
5738
5773
  async function deserializeTransaction(tx) {
5739
5774
  // Literal specifier so bundlers can code-split the lazy chunk.
@@ -6264,4 +6299,4 @@ exports.signInAnonymously = signInAnonymously;
6264
6299
  exports.useAuth = useAuth;
6265
6300
  exports.useBuildRun = useBuildRun;
6266
6301
  exports.useQuery = useQuery;
6267
- //# sourceMappingURL=index-CK36YlGT.js.map
6302
+ //# sourceMappingURL=index-B_uRc6gn.js.map