@bounded-sh/client 0.0.51 → 0.0.52

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 (54) hide show
  1. package/dist/builds/apps.d.ts +2 -0
  2. package/dist/builds/client.d.ts +23 -1
  3. package/dist/builds/index.d.ts +7 -4
  4. package/dist/builds/types.d.ts +66 -0
  5. package/dist/{email-auth-provider-Bm6vmoy3.js → email-auth-provider-6seVxrWq.js} +2 -2
  6. package/dist/{email-auth-provider-Bm6vmoy3.js.map → email-auth-provider-6seVxrWq.js.map} +1 -1
  7. package/dist/{email-auth-provider-CnHsY8U-.js → email-auth-provider-BCI1_WLA.js} +2 -2
  8. package/dist/{email-auth-provider-CnHsY8U-.js.map → email-auth-provider-BCI1_WLA.js.map} +1 -1
  9. package/dist/{email-auth-provider-Bh2fDYcb.mjs → email-auth-provider-D22p_2xV.mjs} +2 -2
  10. package/dist/{email-auth-provider-CdbhqElf.mjs.map → email-auth-provider-D22p_2xV.mjs.map} +1 -1
  11. package/dist/{email-auth-provider-CdbhqElf.mjs → email-auth-provider-uZbdT_Bx.mjs} +2 -2
  12. package/dist/{email-auth-provider-Bh2fDYcb.mjs.map → email-auth-provider-uZbdT_Bx.mjs.map} +1 -1
  13. package/dist/{guest-auth-provider-Xir8zyfZ.mjs → guest-auth-provider-B_9cVFL1.mjs} +2 -2
  14. package/dist/{guest-auth-provider-Xir8zyfZ.mjs.map → guest-auth-provider-B_9cVFL1.mjs.map} +1 -1
  15. package/dist/{guest-auth-provider-CHqB_uN0.js → guest-auth-provider-BrSO-CUp.js} +2 -2
  16. package/dist/{guest-auth-provider-CHqB_uN0.js.map → guest-auth-provider-BrSO-CUp.js.map} +1 -1
  17. package/dist/{guest-auth-provider-fjOMwfpW.js → guest-auth-provider-DY-u2wpK.js} +2 -2
  18. package/dist/{guest-auth-provider-fjOMwfpW.js.map → guest-auth-provider-DY-u2wpK.js.map} +1 -1
  19. package/dist/{guest-auth-provider-Dgmr7e0Z.mjs → guest-auth-provider-ShmskrcH.mjs} +2 -2
  20. package/dist/{guest-auth-provider-Dgmr7e0Z.mjs.map → guest-auth-provider-ShmskrcH.mjs.map} +1 -1
  21. package/dist/{index-Cy0IRs6U.mjs → index-BvUrIsky.mjs} +41 -10
  22. package/dist/index-BvUrIsky.mjs.map +1 -0
  23. package/dist/{index-BsrZb496.js → index-D4jNluH9.js} +43 -9
  24. package/dist/index-D4jNluH9.js.map +1 -0
  25. package/dist/index.js +4 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +1 -1
  28. package/dist/{index.native-BaEZwiWd.js → index.native-2Mmuh7RB.js} +43 -9
  29. package/dist/{index.native-BaEZwiWd.js.map → index.native-2Mmuh7RB.js.map} +1 -1
  30. package/dist/{index.native-B29WKXlr.mjs → index.native-gU1kSEmQ.mjs} +41 -10
  31. package/dist/index.native-gU1kSEmQ.mjs.map +1 -0
  32. package/dist/index.native.js +4 -1
  33. package/dist/index.native.js.map +1 -1
  34. package/dist/index.native.mjs +1 -1
  35. package/dist/{injected-evm-wallet-provider-CEWIg-_U.js → injected-evm-wallet-provider-BEGvuTUU.js} +2 -2
  36. package/dist/{injected-evm-wallet-provider-CEWIg-_U.js.map → injected-evm-wallet-provider-BEGvuTUU.js.map} +1 -1
  37. package/dist/{injected-evm-wallet-provider-DWnpa6Yx.mjs → injected-evm-wallet-provider-CNnMBwAY.mjs} +2 -2
  38. package/dist/{injected-evm-wallet-provider-DWnpa6Yx.mjs.map → injected-evm-wallet-provider-CNnMBwAY.mjs.map} +1 -1
  39. package/dist/{injected-evm-wallet-provider-DkyIMRce.mjs → injected-evm-wallet-provider-COM5BPuY.mjs} +2 -2
  40. package/dist/{injected-evm-wallet-provider-DkyIMRce.mjs.map → injected-evm-wallet-provider-COM5BPuY.mjs.map} +1 -1
  41. package/dist/{injected-evm-wallet-provider-DUyX7Xj9.js → injected-evm-wallet-provider-DoB2BLir.js} +2 -2
  42. package/dist/{injected-evm-wallet-provider-DUyX7Xj9.js.map → injected-evm-wallet-provider-DoB2BLir.js.map} +1 -1
  43. package/dist/{injected-wallet-provider-DqBpuASt.mjs → injected-wallet-provider-CGoMdKhp.mjs} +2 -2
  44. package/dist/{injected-wallet-provider-DqBpuASt.mjs.map → injected-wallet-provider-CGoMdKhp.mjs.map} +1 -1
  45. package/dist/{injected-wallet-provider-DsesEVnZ.mjs → injected-wallet-provider-CLeRnTLu.mjs} +2 -2
  46. package/dist/{injected-wallet-provider-DsesEVnZ.mjs.map → injected-wallet-provider-CLeRnTLu.mjs.map} +1 -1
  47. package/dist/{injected-wallet-provider-DpJvuK73.js → injected-wallet-provider-CyCGjf2G.js} +2 -2
  48. package/dist/{injected-wallet-provider-DpJvuK73.js.map → injected-wallet-provider-CyCGjf2G.js.map} +1 -1
  49. package/dist/{injected-wallet-provider-C65NiItg.js → injected-wallet-provider-g0md2vEj.js} +2 -2
  50. package/dist/{injected-wallet-provider-C65NiItg.js.map → injected-wallet-provider-g0md2vEj.js.map} +1 -1
  51. package/package.json +2 -2
  52. package/dist/index-BsrZb496.js.map +0 -1
  53. package/dist/index-Cy0IRs6U.mjs.map +0 -1
  54. package/dist/index.native-B29WKXlr.mjs.map +0 -1
package/dist/index.js CHANGED
@@ -1,11 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BsrZb496.js');
3
+ var index = require('./index-D4jNluH9.js');
4
4
  var core = require('@bounded-sh/core');
5
5
  require('react');
6
6
 
7
7
 
8
8
 
9
+ exports.BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = index.BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA;
10
+ exports.BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = index.BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA;
11
+ exports.BUILD_REVIEW_CAPABILITY_SCHEMA = index.BUILD_REVIEW_CAPABILITY_SCHEMA;
9
12
  exports.BuildsApiError = index.BuildsApiError;
10
13
  exports.FAILURE_REASONS = index.FAILURE_REASONS;
11
14
  exports.NON_TERMINAL_STATES = index.NON_TERMINAL_STATES;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { M as BuildsApiError, U as FAILURE_REASONS, N as NON_TERMINAL_STATES, O as OffchainAuthProvider, Q as PARK_REASONS, P as PrivyExpoProvider, R as RUN_STATES, T as TERMINAL_STATES, G as apps, L as builds, z as completeLoginFromRedirect, B as completeLoginInPopup, k as defaultInjectedEvmProvider, d as defaultInjectedProvider, H as deserializeTransaction, q as getAuthLoading, v as getAuthProvider, m as getCurrentUser, I as getIdToken, g as getPlatform, l as init, t as login, A as loginWithPopup, x as loginWithPrivy, y as loginWithRedirect, u as logout, p as onAuthLoadingChanged, o as onAuthStateChanged, K as requestEip6963Providers, J as setPlatform, w as signInAnonymously, C as useAuth, F as useBuildRun, D as useQuery } from './index-Cy0IRs6U.mjs';
1
+ export { X as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, W as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, V as BUILD_REVIEW_CAPABILITY_SCHEMA, M as BuildsApiError, U as FAILURE_REASONS, N as NON_TERMINAL_STATES, O as OffchainAuthProvider, Q as PARK_REASONS, P as PrivyExpoProvider, R as RUN_STATES, T as TERMINAL_STATES, G as apps, L as builds, z as completeLoginFromRedirect, B as completeLoginInPopup, k as defaultInjectedEvmProvider, d as defaultInjectedProvider, H as deserializeTransaction, q as getAuthLoading, v as getAuthProvider, m as getCurrentUser, I as getIdToken, g as getPlatform, l as init, t as login, A as loginWithPopup, x as loginWithPrivy, y as loginWithRedirect, u as logout, p as onAuthLoadingChanged, o as onAuthStateChanged, K as requestEip6963Providers, J as setPlatform, w as signInAnonymously, C as useAuth, F as useBuildRun, D as useQuery } from './index-BvUrIsky.mjs';
2
2
  export * from '@bounded-sh/core';
3
3
  export { BoundedDeclineError, DECLINE_EVENT_NAME, RATE_LIMIT_EVENT_NAME, aggregate, count, deriveDecline, dispatchDeclineEvent, dispatchRateLimitEvent, docId, get, getConfig, getFiles, getMany, queryAggregate, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe } from '@bounded-sh/core';
4
4
  import 'react';
@@ -4466,7 +4466,7 @@ async function getAuthProvider(config) {
4466
4466
  // manager as legacy email sessions. Human login should be started
4467
4467
  // with loginWithRedirect(); this provider is kept as the restore and
4468
4468
  // logout surface for those sessions.
4469
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-CnHsY8U-.js'); })).EmailAuthProvider();
4469
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-BCI1_WLA.js'); })).EmailAuthProvider();
4470
4470
  break;
4471
4471
  case "wallet":
4472
4472
  case "phantom": {
@@ -4485,7 +4485,7 @@ async function getAuthProvider(config) {
4485
4485
  if (!isWalletLoginEnabled(config)) {
4486
4486
  throw walletLoginNotEnabledError(authMethod);
4487
4487
  }
4488
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-C65NiItg.js'); });
4488
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-g0md2vEj.js'); });
4489
4489
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
4490
4490
  break;
4491
4491
  }
@@ -4498,7 +4498,7 @@ async function getAuthProvider(config) {
4498
4498
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
4499
4499
  // to point at a specific wallet or set chainId/domain.
4500
4500
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
4501
- const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-DUyX7Xj9.js'); });
4501
+ const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-DoB2BLir.js'); });
4502
4502
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
4503
4503
  break;
4504
4504
  }
@@ -4526,7 +4526,7 @@ async function getAuthProvider(config) {
4526
4526
  break;
4527
4527
  case "guest":
4528
4528
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
4529
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-fjOMwfpW.js'); })).GuestAuthProvider();
4529
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DY-u2wpK.js'); })).GuestAuthProvider();
4530
4530
  break;
4531
4531
  }
4532
4532
  if (!currentAuthProvider) {
@@ -4582,7 +4582,7 @@ async function signInAnonymously() {
4582
4582
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
4583
4583
  // the main bundle for data-only apps. Specifier is a static string literal
4584
4584
  // so bundle-splitting can see it.
4585
- const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-fjOMwfpW.js'); })).GuestAuthProvider();
4585
+ const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DY-u2wpK.js'); })).GuestAuthProvider();
4586
4586
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
4587
4587
  const commit = (user) => {
4588
4588
  // No await/interleaving inside this block: provider/method/config/marker
@@ -5299,6 +5299,31 @@ async function decideGate(appId, runId, gateId, options) {
5299
5299
  const { intentKey: _intentKey, idempotencyKey: _suppliedKey } = options, decision = __rest(options, ["intentKey", "idempotencyKey"]);
5300
5300
  return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/decision`, { method: 'POST', body: Object.assign(Object.assign({}, decision), { idempotencyKey }) });
5301
5301
  }
5302
+ async function refreshReviewCapability(appId, runId, gateId, options) {
5303
+ const idempotencyKey = actionIdempotencyKey(options, 'refreshReviewCapability()');
5304
+ return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/review-capability/refresh`, {
5305
+ method: 'POST',
5306
+ body: {
5307
+ expectedGeneration: options.expectedGeneration,
5308
+ expectedExpiresAtMs: options.expectedExpiresAtMs,
5309
+ expectedRecoveryUntilMs: options.expectedRecoveryUntilMs,
5310
+ expectedAudience: options.expectedAudience,
5311
+ expectedReviewerBindingHash: options.expectedReviewerBindingHash,
5312
+ idempotencyKey,
5313
+ },
5314
+ });
5315
+ }
5316
+ /**
5317
+ * Read one exact delegated-review capability and its narrow lifecycle result.
5318
+ * This does not refresh or extend the window and exposes no generic run-view
5319
+ * authority.
5320
+ */
5321
+ async function getReviewCapability(appId, runId, gateId, options) {
5322
+ return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/review-capability`, {
5323
+ method: 'POST',
5324
+ body: { expectedPreviewUrl: options.expectedPreviewUrl },
5325
+ });
5326
+ }
5302
5327
  async function topup(appId, runId, options) {
5303
5328
  return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/topup`, { method: 'POST', body: options });
5304
5329
  }
@@ -5344,6 +5369,9 @@ const FAILURE_REASONS = [
5344
5369
  'bind_failed',
5345
5370
  'internal_error',
5346
5371
  ];
5372
+ const BUILD_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-review-capability.v1';
5373
+ const BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = 'bounded.build-review-capability-refresh.v1';
5374
+ const BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-delegated-review-capability.v1';
5347
5375
 
5348
5376
  const NORMAL_POLL_MS = 2000;
5349
5377
  const PARKED_POLL_MS = 5000;
@@ -5580,22 +5608,25 @@ function useBuildRun(appId, runId, options) {
5580
5608
  }
5581
5609
 
5582
5610
  /**
5583
- * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost) —
5584
- * dev-api CORS blocks calls from generated-app origins. Server-side callers unaffected.
5611
+ * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost), with
5612
+ * one exact Drafted exception for delegated review/decision routes. Other
5613
+ * generated-app origins remain blocked; server-side callers are unaffected.
5585
5614
  */
5586
5615
  const builds = {
5587
5616
  submit,
5588
5617
  get,
5618
+ getReviewCapability,
5589
5619
  events,
5590
5620
  cancel,
5591
5621
  decideGate,
5622
+ refreshReviewCapability,
5592
5623
  topup,
5593
5624
  list: list$1,
5594
5625
  watch,
5595
5626
  };
5596
5627
 
5597
5628
  async function create(options = {}) {
5598
- const body = Object.assign(Object.assign(Object.assign(Object.assign({}, (options.name !== undefined ? { name: options.name } : {})), (options.prompt !== undefined ? { prompt: options.prompt } : {})), (options.clientToken !== undefined ? { clientToken: options.clientToken } : {})), (options.intent !== undefined ? { intent: options.intent } : {}));
5629
+ const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.name !== undefined ? { name: options.name } : {})), (options.prompt !== undefined ? { prompt: options.prompt } : {})), (options.clientToken !== undefined ? { clientToken: options.clientToken } : {})), (options.intent !== undefined ? { intent: options.intent } : {})), (options.oapp === true ? { oapp: true } : {}));
5599
5630
  const app = await requestDevApi('/apps/new', {
5600
5631
  method: 'POST',
5601
5632
  body,
@@ -6041,6 +6072,9 @@ class PrivyExpoProvider {
6041
6072
  }
6042
6073
  }
6043
6074
 
6075
+ exports.BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA;
6076
+ exports.BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA;
6077
+ exports.BUILD_REVIEW_CAPABILITY_SCHEMA = BUILD_REVIEW_CAPABILITY_SCHEMA;
6044
6078
  exports.BuildsApiError = BuildsApiError;
6045
6079
  exports.EMBEDDED_WALLET_UNSUPPORTED = EMBEDDED_WALLET_UNSUPPORTED;
6046
6080
  exports.FAILURE_REASONS = FAILURE_REASONS;
@@ -6084,4 +6118,4 @@ exports.setPlatform = setPlatform;
6084
6118
  exports.signInAnonymously = signInAnonymously;
6085
6119
  exports.useAuth = useAuth;
6086
6120
  exports.useBuildRun = useBuildRun;
6087
- //# sourceMappingURL=index.native-BaEZwiWd.js.map
6121
+ //# sourceMappingURL=index.native-2Mmuh7RB.js.map