bulletin-deploy 0.19.3 → 0.19.4

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 (69) hide show
  1. package/assets/environments.json +5 -5
  2. package/bin/bulletin-deploy +10 -1
  3. package/dist/auth/index.js +7 -7
  4. package/dist/auth/vendor/index.js +2 -2
  5. package/dist/auth-config.js +5 -5
  6. package/dist/bug-report.js +5 -4
  7. package/dist/chain-health.js +4 -3
  8. package/dist/{chunk-PSYA6E5M.js → chunk-2P4EZOFF.js} +1 -1
  9. package/dist/{chunk-NA3SXVY6.js → chunk-3NR3T7US.js} +22 -12
  10. package/dist/{chunk-6FQJLLEF.js → chunk-6J4WRFRL.js} +1 -1
  11. package/dist/{chunk-LPTKBQII.js → chunk-7DDOVCV5.js} +1 -1
  12. package/dist/{chunk-I5PNPQZO.js → chunk-ANX3RZAS.js} +38 -10
  13. package/dist/{chunk-IP6ABIIC.js → chunk-BFK5UCUJ.js} +29 -4
  14. package/dist/{chunk-H4OZ6PTA.js → chunk-C437RTTU.js} +8 -8
  15. package/dist/{chunk-VBIFKNUS.js → chunk-CCIBF55X.js} +1 -1
  16. package/dist/{chunk-IW3X2MJF.js → chunk-D3YME2EG.js} +30 -1
  17. package/dist/{chunk-6MSHWNJT.js → chunk-D6BE3RAU.js} +138 -54
  18. package/dist/{chunk-3MAIF2SF.js → chunk-F24S4EV5.js} +49 -7
  19. package/dist/{chunk-WPC2PUCV.js → chunk-H44LXDQJ.js} +43 -8
  20. package/dist/{chunk-5FLTDWWP.js → chunk-H44NO63C.js} +1 -1
  21. package/dist/{chunk-3ACNAWUD.js → chunk-JTH3ISLR.js} +3 -3
  22. package/dist/{chunk-NKDGBZBP.js → chunk-O56KLG7Z.js} +2 -2
  23. package/dist/{chunk-KTKFHROI.js → chunk-OONQPYHM.js} +4 -4
  24. package/dist/{chunk-SNFGJOR2.js → chunk-R3BXRRKE.js} +1 -1
  25. package/dist/{chunk-ZOC4GITL.js → chunk-SH2LG52Z.js} +5 -1
  26. package/dist/{chunk-ABMNC34K.js → chunk-U2QO5G35.js} +2 -2
  27. package/dist/{chunk-QU5GJF6U.js → chunk-UFP2XWZ4.js} +3 -3
  28. package/dist/chunk-ZG3HAH5A.js +18 -0
  29. package/dist/{chunk-RJDHC56V.js → chunk-ZZIOS4RG.js} +53 -16
  30. package/dist/chunk-probe.js +4 -3
  31. package/dist/commands/login.js +24 -23
  32. package/dist/commands/logout.js +7 -7
  33. package/dist/commands/transfer.js +7 -6
  34. package/dist/commands/whoami.js +5 -5
  35. package/dist/deploy-actors.js +10 -9
  36. package/dist/deploy.d.ts +45 -18
  37. package/dist/deploy.js +30 -20
  38. package/dist/dotns.d.ts +56 -2
  39. package/dist/dotns.js +9 -6
  40. package/dist/environments.d.ts +7 -1
  41. package/dist/environments.js +2 -2
  42. package/dist/errors.d.ts +5 -1
  43. package/dist/errors.js +7 -3
  44. package/dist/incremental-stats.d.ts +14 -0
  45. package/dist/incremental-stats.js +1 -1
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.js +23 -22
  48. package/dist/manifest/config-load.js +3 -3
  49. package/dist/manifest/publish.d.ts +1 -0
  50. package/dist/manifest/publish.js +23 -22
  51. package/dist/manifest/schema.js +1 -1
  52. package/dist/manifest-embed.js +2 -2
  53. package/dist/manifest-fetch.js +2 -2
  54. package/dist/manifest-roundtrip.js +2 -2
  55. package/dist/manifest.d.ts +14 -1
  56. package/dist/manifest.js +5 -1
  57. package/dist/memory-report.js +3 -2
  58. package/dist/merkle.js +20 -19
  59. package/dist/mnemonic.d.ts +35 -0
  60. package/dist/mnemonic.js +8 -0
  61. package/dist/personhood/bootstrap.js +7 -6
  62. package/dist/personhood/people-client.js +7 -6
  63. package/dist/run-state.js +1 -1
  64. package/dist/sss-allowance-cache.js +6 -6
  65. package/dist/storage-signer.js +20 -19
  66. package/dist/telemetry.d.ts +2 -1
  67. package/dist/telemetry.js +5 -2
  68. package/dist/version-check.js +4 -3
  69. package/package.json +4 -4
@@ -6,8 +6,12 @@ var NonRetryableError = class extends Error {
6
6
  }
7
7
  };
8
8
  var EXIT_CODE_NO_RETRY = 78;
9
+ var SHIPPED_CONFIG_ORIGIN = "assets/environments.json shipped with bulletin-deploy";
10
+ var FALLBACK_CONFIG_ORIGIN = "the built-in fallback for";
9
11
 
10
12
  export {
11
13
  NonRetryableError,
12
- EXIT_CODE_NO_RETRY
14
+ EXIT_CODE_NO_RETRY,
15
+ SHIPPED_CONFIG_ORIGIN,
16
+ FALLBACK_CONFIG_ORIGIN
13
17
  };
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-TSPERKUS.js";
4
4
  import {
5
5
  loadEnvironments
6
- } from "./chunk-NA3SXVY6.js";
6
+ } from "./chunk-3NR3T7US.js";
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-IP6ABIIC.js";
9
+ } from "./chunk-BFK5UCUJ.js";
10
10
 
11
11
  // src/auth-config.ts
12
12
  import { existsSync, readdirSync } from "fs";
@@ -2,15 +2,15 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-SNFGJOR2.js";
5
+ } from "./chunk-R3BXRRKE.js";
6
6
  import {
7
7
  VERSION,
8
8
  getCurrentSentryTraceId,
9
9
  resolveIssueRepoSlug
10
- } from "./chunk-IP6ABIIC.js";
10
+ } from "./chunk-BFK5UCUJ.js";
11
11
  import {
12
12
  package_default
13
- } from "./chunk-KTKFHROI.js";
13
+ } from "./chunk-OONQPYHM.js";
14
14
 
15
15
  // src/bug-report.ts
16
16
  import { execSync, execFileSync } from "child_process";
@@ -0,0 +1,18 @@
1
+ // src/mnemonic.ts
2
+ function resolveEffectiveMnemonic(opts) {
3
+ return normalizeMnemonic(opts.flagMnemonic) ?? normalizeMnemonic(opts.envMnemonic) ?? normalizeMnemonic(opts.envDotnsMnemonic);
4
+ }
5
+ function normalizeMnemonic(value) {
6
+ return value !== void 0 && value.trim().length > 0 ? value : void 0;
7
+ }
8
+ function mnemonicConflictNotice(opts) {
9
+ const a = normalizeMnemonic(opts.envMnemonic);
10
+ const b = normalizeMnemonic(opts.envDotnsMnemonic);
11
+ if (!a || !b || a === b) return null;
12
+ return "Both MNEMONIC and DOTNS_MNEMONIC are set, to different values \u2014 using MNEMONIC. Set only one of the two, or pass --mnemonic explicitly, to avoid ambiguity.";
13
+ }
14
+
15
+ export {
16
+ resolveEffectiveMnemonic,
17
+ mnemonicConflictNotice
18
+ };
@@ -1,19 +1,20 @@
1
1
  import {
2
2
  PGAS_ASSET_LOCATION
3
3
  } from "./chunk-SI2ZUOYD.js";
4
+ import {
5
+ mnemonicConflictNotice,
6
+ resolveEffectiveMnemonic
7
+ } from "./chunk-ZG3HAH5A.js";
4
8
  import {
5
9
  isTestnetSpecName,
6
10
  testnetFromNetworkField
7
11
  } from "./chunk-FWJQAIVO.js";
8
12
  import {
9
13
  validateContractAddresses
10
- } from "./chunk-NA3SXVY6.js";
11
- import {
12
- NonRetryableError
13
- } from "./chunk-ZOC4GITL.js";
14
+ } from "./chunk-3NR3T7US.js";
14
15
  import {
15
16
  ChainHealthSampler
16
- } from "./chunk-VBIFKNUS.js";
17
+ } from "./chunk-CCIBF55X.js";
17
18
  import {
18
19
  captureWarning,
19
20
  markCodePath,
@@ -21,7 +22,10 @@ import {
21
22
  setDeploySentryTag,
22
23
  truncateAddress,
23
24
  withSpan
24
- } from "./chunk-IP6ABIIC.js";
25
+ } from "./chunk-BFK5UCUJ.js";
26
+ import {
27
+ NonRetryableError
28
+ } from "./chunk-SH2LG52Z.js";
25
29
  import {
26
30
  HIGHEST_VERIFIED_DOTNS_RELEASE,
27
31
  POP_CONTROLLER_PROBE_ABI,
@@ -81,7 +85,7 @@ var FEE_FLOOR_OWNED = ONE_PAS / 100n;
81
85
  var FEE_FLOOR_REGISTER = ONE_PAS / 10n;
82
86
  var TOP_UP_TARGET = ONE_PAS / 2n;
83
87
  var SOURCE_BUFFER = ONE_PAS;
84
- var MINIMUM_REGISTER_STORAGE_DEPOSIT = 2000000000000n;
88
+ var MINIMUM_REGISTER_STORAGE_DEPOSIT = 50000000000n;
85
89
  function registerDepositWei(userStatus, startingPriceWei) {
86
90
  return userStatus === ProofOfPersonhoodStatus.NoStatus ? startingPriceWei : 0n;
87
91
  }
@@ -119,6 +123,12 @@ function storageDepositLimitFor(estimate, floor = MINIMUM_REGISTER_STORAGE_DEPOS
119
123
  const buffered = estimate * 120n / 100n;
120
124
  return buffered < floor ? floor : buffered;
121
125
  }
126
+ function weightLimitFor(gasRequired) {
127
+ return {
128
+ ref_time: gasRequired.referenceTime * 120n / 100n,
129
+ proof_size: gasRequired.proofSize * 120n / 100n
130
+ };
131
+ }
122
132
  function feeFloorFor(plannedAction, storageDeposit = MINIMUM_REGISTER_STORAGE_DEPOSIT, rentPriceNative = 0n, transferFeeNative = 0n) {
123
133
  if (isOwnedAction(plannedAction)) return FEE_FLOOR_OWNED + transferFeeNative;
124
134
  return FEE_FLOOR_REGISTER + storageDeposit + rentPriceNative + transferFeeNative;
@@ -548,9 +558,15 @@ function formatContractDryRunFailure(gasEstimate, context) {
548
558
  const isBareRevert = isBareRevertResult(gasEstimate.revertData, gasEstimate.revertFlags);
549
559
  if (isBareRevert && BARE_REVERT_DIAGNOSTIC_FUNCTIONS.has(functionName)) {
550
560
  if (functionName === "register") {
561
+ const floor = context.registerStorageDeposit ?? MINIMUM_REGISTER_STORAGE_DEPOSIT;
551
562
  lines.push(
552
563
  ` diagnostic: bare-revert (empty 0x) during register. Most likely cause: insufficient signer balance for storage deposit.`,
553
- ` A fresh TLD register() requires sufficient free balance to cover the chain's storage deposit (typically 200+ PAS).`,
564
+ // #1518: this used to say "typically 200+ PAS" — a hardcoded, never-measured figure.
565
+ // The real chain-side storage deposit is well under 1 PAS (see MINIMUM_REGISTER_STORAGE_DEPOSIT's
566
+ // doc comment); the number that actually matters is the FLOOR this specific call declared,
567
+ // since pallet-revive requires the signer's free balance to cover the declared limit, not the
568
+ // (much smaller) real charge. Name that configured value here so a user tops up the right amount.
569
+ ` A fresh TLD register() requires sufficient free balance to cover the declared storage-deposit limit (currently ${fmtPas(floor)} PAS for this environment).`,
554
570
  ` Other possible causes:`,
555
571
  ` 1. PoP status changed between preflight and registration (race condition).`,
556
572
  ` 2. Commitment timing: the revealed commitment is still too new or already expired.`,
@@ -889,10 +905,23 @@ var ReviveClientWrapper = class _ReviveClientWrapper {
889
905
  static DRY_RUN_WEIGHT_LIMIT = { ref_time: 18446744073709551615n, proof_size: 18446744073709551615n };
890
906
  client;
891
907
  mappedAccounts;
908
+ // #1518: the storage-deposit floor this wrapper declares on every Revive.call
909
+ // it dry-runs/submits (dryRunReviveCall, submitTransaction, submitBatchedTransactions).
910
+ // Defaults to the module constant so a wrapper nobody configured (e.g. a bare
911
+ // `new ReviveClientWrapper(api)` in a test) still declares a SAFE, measured
912
+ // floor rather than silently falling back to 0. DotNS.recreateReviveClient —
913
+ // the only place a wrapper is ever constructed — calls setStorageDepositFloor
914
+ // right after construction, so every dry-run path through this wrapper picks
915
+ // up the owning DotNS instance's configured/measured value automatically; no
916
+ // per-call parameter to thread (and forget) at each new call site.
917
+ _storageDepositFloor = MINIMUM_REGISTER_STORAGE_DEPOSIT;
892
918
  constructor(client) {
893
919
  this.client = client;
894
920
  this.mappedAccounts = /* @__PURE__ */ new Set();
895
921
  }
922
+ setStorageDepositFloor(floor) {
923
+ this._storageDepositFloor = floor;
924
+ }
896
925
  async getEvmAddress(substrateAddress) {
897
926
  if (isAddress(substrateAddress)) return substrateAddress;
898
927
  const address = await this.client.apis.ReviveApi.address(substrateAddress);
@@ -1166,13 +1195,14 @@ var ReviveClientWrapper = class _ReviveClientWrapper {
1166
1195
  value,
1167
1196
  encodedData,
1168
1197
  args: context.args,
1169
- contracts: context.contracts
1198
+ contracts: context.contracts,
1199
+ registerStorageDeposit: this._storageDepositFloor
1170
1200
  });
1171
1201
  throw new ContractDryRunRevertError(msg, gasEstimate.revertData ?? "0x", gasEstimate.revertFlags ?? 0n);
1172
1202
  }
1173
1203
  return {
1174
- weight_limit: { ref_time: gasEstimate.gasRequired.referenceTime, proof_size: gasEstimate.gasRequired.proofSize },
1175
- storage_deposit_limit: storageDepositLimitFor(gasEstimate.storageDeposit)
1204
+ weight_limit: weightLimitFor(gasEstimate.gasRequired),
1205
+ storage_deposit_limit: storageDepositLimitFor(gasEstimate.storageDeposit, this._storageDepositFloor)
1176
1206
  };
1177
1207
  }
1178
1208
  async submitTransaction(contractAddress, value, encodedData, signerSubstrateAddress, signer, statusCallback, { rpcs, useNoncePolling, functionName, args, contracts, verifyEffect, feeAsset, isPhoneSigner, onResign }) {
@@ -1517,6 +1547,7 @@ var DotNS = class _DotNS {
1517
1547
  }
1518
1548
  this.client = createClient(getWsProvider(endpoint, { heartbeatTimeout: WS_HEARTBEAT_TIMEOUT_MS }));
1519
1549
  this.clientWrapper = new ReviveClientWrapper(this.client.getUnsafeApi());
1550
+ this.clientWrapper.setStorageDepositFloor(this._registerStorageDeposit);
1520
1551
  this.chainHealth.attach(this.client, endpoint);
1521
1552
  }
1522
1553
  async connect(options = {}) {
@@ -1557,7 +1588,15 @@ var DotNS = class _DotNS {
1557
1588
  this.signer = options.signer;
1558
1589
  this.substrateAddress = options.signerAddress;
1559
1590
  } else {
1560
- const mnemonicArg = options.mnemonic || process.env.DOTNS_MNEMONIC || process.env.MNEMONIC;
1591
+ if (!options.mnemonic) {
1592
+ const notice = mnemonicConflictNotice({ envMnemonic: process.env.MNEMONIC, envDotnsMnemonic: process.env.DOTNS_MNEMONIC });
1593
+ if (notice) console.error(notice);
1594
+ }
1595
+ const mnemonicArg = resolveEffectiveMnemonic({
1596
+ flagMnemonic: options.mnemonic,
1597
+ envMnemonic: process.env.MNEMONIC,
1598
+ envDotnsMnemonic: process.env.DOTNS_MNEMONIC
1599
+ });
1561
1600
  const keyUriArg = options.keyUri || process.env.DOTNS_KEY_URI;
1562
1601
  let source = keyUriArg || mnemonicArg || DEFAULT_MNEMONIC;
1563
1602
  const isKeyUri = Boolean(keyUriArg);
@@ -2643,10 +2682,7 @@ var DotNS = class _DotNS {
2643
2682
  contracts: this._contracts
2644
2683
  }));
2645
2684
  }
2646
- const weight_limit = {
2647
- proof_size: headEstimate.gasRequired.proofSize,
2648
- ref_time: headEstimate.gasRequired.referenceTime
2649
- };
2685
+ const weight_limit = weightLimitFor(headEstimate.gasRequired);
2650
2686
  const storage_deposit_limit = storageDepositLimitFor(headEstimate.storageDeposit, this._registerStorageDeposit);
2651
2687
  const client = this.clientWrapper.client;
2652
2688
  const buildBatch = () => {
@@ -3792,6 +3828,7 @@ export {
3792
3828
  weiToNative,
3793
3829
  fmtPas,
3794
3830
  storageDepositLimitFor,
3831
+ weightLimitFor,
3795
3832
  feeFloorFor,
3796
3833
  RPC_ENDPOINTS,
3797
3834
  CONTRACTS,
@@ -9,9 +9,10 @@ import {
9
9
  getBestBlockNumber,
10
10
  probeChunks,
11
11
  probeFinalityGap
12
- } from "./chunk-PSYA6E5M.js";
13
- import "./chunk-IP6ABIIC.js";
14
- import "./chunk-KTKFHROI.js";
12
+ } from "./chunk-2P4EZOFF.js";
13
+ import "./chunk-BFK5UCUJ.js";
14
+ import "./chunk-OONQPYHM.js";
15
+ import "./chunk-SH2LG52Z.js";
15
16
  export {
16
17
  ChainProbeCrossValidationError,
17
18
  ChainProbeMetadataError,
@@ -4,54 +4,55 @@ import {
4
4
  import {
5
5
  isBenignTeardownError,
6
6
  waitForBulletinAuthorization
7
- } from "../chunk-6MSHWNJT.js";
8
- import "../chunk-HNJWIY55.js";
9
- import "../chunk-M5AKL3FL.js";
7
+ } from "../chunk-D6BE3RAU.js";
10
8
  import {
11
9
  preflightSssAllowance
12
- } from "../chunk-6FQJLLEF.js";
10
+ } from "../chunk-6J4WRFRL.js";
13
11
  import {
14
12
  statementSigningAccount
15
13
  } from "../chunk-GRPLHUYC.js";
16
- import "../chunk-IW3X2MJF.js";
17
- import "../chunk-LPTKBQII.js";
18
- import "../chunk-3MAIF2SF.js";
19
- import "../chunk-WPC2PUCV.js";
20
- import "../chunk-QU5GJF6U.js";
21
- import "../chunk-SNFGJOR2.js";
22
- import "../chunk-PSYA6E5M.js";
14
+ import "../chunk-HNJWIY55.js";
15
+ import "../chunk-M5AKL3FL.js";
16
+ import "../chunk-D3YME2EG.js";
17
+ import "../chunk-7DDOVCV5.js";
18
+ import "../chunk-F24S4EV5.js";
19
+ import "../chunk-H44LXDQJ.js";
20
+ import "../chunk-UFP2XWZ4.js";
21
+ import "../chunk-R3BXRRKE.js";
22
+ import "../chunk-2P4EZOFF.js";
23
23
  import "../chunk-C2TS5MER.js";
24
- import "../chunk-3ACNAWUD.js";
24
+ import "../chunk-JTH3ISLR.js";
25
25
  import "../chunk-JQKKMUCT.js";
26
+ import {
27
+ renderLoginStatus
28
+ } from "../chunk-RIRDBSBG.js";
26
29
  import {
27
30
  BULLETIN_RESOURCE,
28
31
  DEFAULT_RESOURCES,
29
32
  createSlotAccountSigner,
30
33
  requestResourceAllocation,
31
34
  summarizeOutcomes
32
- } from "../chunk-5FLTDWWP.js";
33
- import {
34
- renderLoginStatus
35
- } from "../chunk-RIRDBSBG.js";
36
- import "../chunk-RJDHC56V.js";
35
+ } from "../chunk-H44NO63C.js";
36
+ import "../chunk-ZZIOS4RG.js";
37
37
  import "../chunk-SI2ZUOYD.js";
38
+ import "../chunk-ZG3HAH5A.js";
38
39
  import "../chunk-FWJQAIVO.js";
39
40
  import {
40
41
  DOT_PRODUCT_ID,
41
42
  getAuthClient,
42
43
  getPeopleChainEndpoints,
43
44
  resolveBulletinEndpoints
44
- } from "../chunk-ABMNC34K.js";
45
+ } from "../chunk-U2QO5G35.js";
45
46
  import {
46
47
  CLI_NAME
47
48
  } from "../chunk-TSPERKUS.js";
48
49
  import {
49
50
  loadEnvironments
50
- } from "../chunk-NA3SXVY6.js";
51
- import "../chunk-ZOC4GITL.js";
52
- import "../chunk-VBIFKNUS.js";
53
- import "../chunk-IP6ABIIC.js";
54
- import "../chunk-KTKFHROI.js";
51
+ } from "../chunk-3NR3T7US.js";
52
+ import "../chunk-CCIBF55X.js";
53
+ import "../chunk-BFK5UCUJ.js";
54
+ import "../chunk-OONQPYHM.js";
55
+ import "../chunk-SH2LG52Z.js";
55
56
  import "../chunk-K5SP4OUC.js";
56
57
 
57
58
  // src/commands/login.ts
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  clearSssAllowanceCache
3
- } from "../chunk-6FQJLLEF.js";
3
+ } from "../chunk-6J4WRFRL.js";
4
4
  import "../chunk-GRPLHUYC.js";
5
5
  import "../chunk-JQKKMUCT.js";
6
- import "../chunk-5FLTDWWP.js";
7
6
  import {
8
7
  renderLogoutStatus
9
8
  } from "../chunk-RIRDBSBG.js";
9
+ import "../chunk-H44NO63C.js";
10
10
  import {
11
11
  getAuthClient
12
- } from "../chunk-ABMNC34K.js";
12
+ } from "../chunk-U2QO5G35.js";
13
13
  import "../chunk-TSPERKUS.js";
14
- import "../chunk-NA3SXVY6.js";
15
- import "../chunk-ZOC4GITL.js";
16
- import "../chunk-IP6ABIIC.js";
17
- import "../chunk-KTKFHROI.js";
14
+ import "../chunk-3NR3T7US.js";
15
+ import "../chunk-BFK5UCUJ.js";
16
+ import "../chunk-OONQPYHM.js";
17
+ import "../chunk-SH2LG52Z.js";
18
18
 
19
19
  // src/commands/logout.ts
20
20
  function formatLogout(status) {
@@ -3,8 +3,9 @@ import {
3
3
  DEFAULT_TLD,
4
4
  DotNS,
5
5
  parseDomainName
6
- } from "../chunk-RJDHC56V.js";
6
+ } from "../chunk-ZZIOS4RG.js";
7
7
  import "../chunk-SI2ZUOYD.js";
8
+ import "../chunk-ZG3HAH5A.js";
8
9
  import "../chunk-FWJQAIVO.js";
9
10
  import {
10
11
  CLI_NAME
@@ -13,11 +14,11 @@ import {
13
14
  getPopSelfServeConfig,
14
15
  loadEnvironments,
15
16
  resolveEndpoints
16
- } from "../chunk-NA3SXVY6.js";
17
- import "../chunk-ZOC4GITL.js";
18
- import "../chunk-VBIFKNUS.js";
19
- import "../chunk-IP6ABIIC.js";
20
- import "../chunk-KTKFHROI.js";
17
+ } from "../chunk-3NR3T7US.js";
18
+ import "../chunk-CCIBF55X.js";
19
+ import "../chunk-BFK5UCUJ.js";
20
+ import "../chunk-OONQPYHM.js";
21
+ import "../chunk-SH2LG52Z.js";
21
22
  import "../chunk-K5SP4OUC.js";
22
23
 
23
24
  // src/commands/transfer.ts
@@ -2,14 +2,14 @@ import {
2
2
  STALE_SESSION_MESSAGE,
3
3
  getAuthClient,
4
4
  hasPersistedSession
5
- } from "../chunk-ABMNC34K.js";
5
+ } from "../chunk-U2QO5G35.js";
6
6
  import {
7
7
  CLI_NAME
8
8
  } from "../chunk-TSPERKUS.js";
9
- import "../chunk-NA3SXVY6.js";
10
- import "../chunk-ZOC4GITL.js";
11
- import "../chunk-IP6ABIIC.js";
12
- import "../chunk-KTKFHROI.js";
9
+ import "../chunk-3NR3T7US.js";
10
+ import "../chunk-BFK5UCUJ.js";
11
+ import "../chunk-OONQPYHM.js";
12
+ import "../chunk-SH2LG52Z.js";
13
13
 
14
14
  // src/commands/whoami.ts
15
15
  function formatWhoami(addresses) {
@@ -2,20 +2,21 @@ import {
2
2
  MainnetDefaultWorkerError,
3
3
  resolveDeployActors,
4
4
  resolveStorageSigner
5
- } from "./chunk-3ACNAWUD.js";
5
+ } from "./chunk-JTH3ISLR.js";
6
6
  import "./chunk-JQKKMUCT.js";
7
- import "./chunk-5FLTDWWP.js";
8
7
  import "./chunk-RIRDBSBG.js";
9
- import "./chunk-RJDHC56V.js";
8
+ import "./chunk-H44NO63C.js";
9
+ import "./chunk-ZZIOS4RG.js";
10
10
  import "./chunk-SI2ZUOYD.js";
11
+ import "./chunk-ZG3HAH5A.js";
11
12
  import "./chunk-FWJQAIVO.js";
12
- import "./chunk-ABMNC34K.js";
13
+ import "./chunk-U2QO5G35.js";
13
14
  import "./chunk-TSPERKUS.js";
14
- import "./chunk-NA3SXVY6.js";
15
- import "./chunk-ZOC4GITL.js";
16
- import "./chunk-VBIFKNUS.js";
17
- import "./chunk-IP6ABIIC.js";
18
- import "./chunk-KTKFHROI.js";
15
+ import "./chunk-3NR3T7US.js";
16
+ import "./chunk-CCIBF55X.js";
17
+ import "./chunk-BFK5UCUJ.js";
18
+ import "./chunk-OONQPYHM.js";
19
+ import "./chunk-SH2LG52Z.js";
19
20
  import "./chunk-K5SP4OUC.js";
20
21
  export {
21
22
  MainnetDefaultWorkerError,
package/dist/deploy.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { WsEvent } from 'polkadot-api/ws';
2
2
  import { CID } from 'multiformats/cid';
3
- import { ManifestFileEntry } from './manifest.js';
3
+ import { ManifestFileEntry, EmbeddedManifest } from './manifest.js';
4
4
  import { PhoneSignatureStep, DotNSConnectOptions } from './dotns.js';
5
5
  import { DotnsAbiProfile } from './dotns-protocol.js';
6
6
  import { PopSelfServeConfig } from './environments.js';
7
7
  import { PolkadotSigner } from 'polkadot-api';
8
8
  import { NonRetryableError } from './errors.js';
9
9
  export { EXIT_CODE_NO_RETRY } from './errors.js';
10
+ export { mnemonicConflictNotice, resolveEffectiveMnemonic } from './mnemonic.js';
10
11
  import './personhood/bootstrap.js';
11
12
  import './personhood/bind-personal-id.js';
12
13
  import './personhood/claim-pgas.js';
@@ -217,23 +218,28 @@ declare const ENCRYPT_TAG_LEN = 16;
217
218
  declare const ENCRYPT_KEY_LEN = 32;
218
219
  declare const ENCRYPT_PBKDF2_ITERATIONS = 100000;
219
220
  declare function encryptContent(data: Uint8Array, password: string): Promise<Uint8Array>;
220
- /** storageSigner > signer > mnemonic > pool precedence for storage routing. Exported for unit testing. */
221
- declare function __selectStorageProviderModeForTest(options: Pick<DeployOptions, "storageSigner" | "storageSignerAddress" | "signer" | "signerAddress" | "mnemonic">): "storageSigner" | "signer" | "direct" | "pool";
222
221
  /**
223
- * Resolve the mnemonic the CLI should act with, in precedence order:
224
- * `--mnemonic` flag > `MNEMONIC` env var > `DOTNS_MNEMONIC` env var.
225
- *
226
- * Exists so the bin's flag/env resolution is unit-testable and so the two
227
- * env vars are forwarded consistently (issue #1107: previously the bin only
228
- * forwarded `flags.mnemonic` into `options.mnemonic`, so an env-only mnemonic
229
- * never reached `chooseSignerInput` and a persisted session silently won
230
- * instead — even though `chooseSignerInput` already prefers mnemonic first).
222
+ * storageSigner > signer (unless session-backed with no slot, #1452) > mnemonic > pool
223
+ * precedence for storage routing. `selectStorageReconnect` delegates to this so the two
224
+ * never drift apart (the drift this function's own "ForTest" name once let happen).
225
+ * Exported for unit testing.
231
226
  */
232
- declare function resolveEffectiveMnemonic(opts: {
233
- flagMnemonic: string | undefined;
234
- envMnemonic: string | undefined;
235
- envDotnsMnemonic: string | undefined;
236
- }): string | undefined;
227
+ declare function __selectStorageProviderModeForTest(options: Pick<DeployOptions, "storageSigner" | "storageSignerAddress" | "signer" | "signerAddress" | "mnemonic" | "sessionSigner">): "storageSigner" | "signer" | "direct" | "pool";
228
+ /**
229
+ * Build the signer-related DeployOptions fields from a resolved `resolveDeployActors`
230
+ * result. Pulled out of the resolve branch (#1452) so the session-vs-local distinction
231
+ * that gates Bulletin storage routing is directly unit-testable without exercising
232
+ * `resolveDeployActors`' SSO stack. Exported for unit testing.
233
+ */
234
+ declare function deployActorsToSignerOptions(actors: {
235
+ worker: {
236
+ signer: PolkadotSigner;
237
+ address: string;
238
+ source: string;
239
+ };
240
+ recipientH160?: string;
241
+ }): Pick<DeployOptions, "signer" | "signerAddress" | "transferTo" | "sessionSigner">;
242
+
237
243
  /**
238
244
  * Resolve the environment id the CLI should target, in precedence order:
239
245
  * `--env` flag > `BULLETIN_DEPLOY_ENV` env var. Returns `undefined` when
@@ -520,7 +526,17 @@ declare function storeDirectory(directoryPath: string, providerOrOptions?: Exist
520
526
  ipfsCid: string;
521
527
  carBytes: Uint8Array;
522
528
  }>;
523
- declare function buildFilesMap(buildDir: string, fileCids?: Map<string, string>): Record<string, ManifestFileEntry>;
529
+ declare function buildFilesMap(buildDir: string, fileCids?: Map<string, string>, framework?: string | null): Record<string, ManifestFileEntry>;
530
+ declare function computeClassificationPrecision(fileCids: Map<string, string>, filesMap: Record<string, ManifestFileEntry>, prevManifest: EmbeddedManifest | null | undefined, sampleCap?: number): {
531
+ filesStableGroundTruth: number;
532
+ filesStablePacked: number;
533
+ heuristicAgreeStable: number;
534
+ heuristicAgreeVolatile: number;
535
+ heuristicFalseVolatile: number;
536
+ heuristicFalseStable: number;
537
+ unhashedStableSample: string[];
538
+ };
539
+ declare function detectBuildMarkers(directoryPath: string): string[];
524
540
  declare function detectFramework(directoryPath: string): string | null;
525
541
  type SizeDecision = {
526
542
  kind: "ok";
@@ -563,6 +579,17 @@ interface DeployOptions {
563
579
  * genuine QR/mobile injected signers leave it unset.
564
580
  */
565
581
  localSigner?: boolean;
582
+ /**
583
+ * Internal: `signer`/`signerAddress` were resolved from a phone-backed login
584
+ * session (`resolveDeployActors`' `actors.worker.source === "session"`), as
585
+ * opposed to a local `--suri`/`--mnemonic`-derived worker or a caller-injected
586
+ * `PolkadotSigner` (programmatic callers, e.g. playground-cli — #811/S7).
587
+ * Set by `deployActorsToSignerOptions`. Storage routing must not silently
588
+ * sign Bulletin chunks with this signer when no allowance slot is
589
+ * available: `resolveStorageSigner` returning null documents "→ pool", and
590
+ * a session signer with no slot must actually honor that. See #1452.
591
+ */
592
+ sessionSigner?: boolean;
566
593
  /** Pre-built signer — skips mnemonic derivation. Use for QR/mobile signing. */
567
594
  signer?: PolkadotSigner;
568
595
  /** SS58 address for the signer (required when signer is provided). */
@@ -774,4 +801,4 @@ declare function computePhoneSigningSteps(dotnsPreflight: {
774
801
  needsPopUpgrade: boolean;
775
802
  } | null): string[];
776
803
 
777
- export { BLAKE2B_256_MULTIHASH_CODE, BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, type ChainError, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, NonRetryableError, PhoneSignatureStep, SHA256_MULTIHASH_CODE, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __chunkFailureErrorForTest, __getBulletinAuthorizationContextForTest, __selectStorageProviderModeForTest, __storeChunkForTest, __waitForChainLivenessForTest, applyManifestFetchAttributes, assertPoolFallbackAllowed, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deriveRootSigner, describeSlotFallbackReason, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, extractInvalidTransactionVariant, formatStorageSignerLine, formatSubdomainParentError, formatTransferModeDotnsLine, formatTransferModeStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, isPoolFallbackAllowed, makeBulletinStatusHandler, merkleize, nonInteractivePhoneConfirmationError, partitionFinalityProbe, probeP2pRetrieval, reconcileTimedOutChunk, resolveBulletinEndpoints, resolveDotnsConnectOptions, resolveEffectiveMnemonic, resolveEnvId, resolveProductSigner, resolveReproducibleTimestamp, retryBudgetExhausted, selectStorageReconnect, setBulletinAuthorizationContext, setBulletinEndpoints, setWsHaltCallback, shouldHandoverName, shouldPublishManifest, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile };
804
+ export { BLAKE2B_256_MULTIHASH_CODE, BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, type ChainError, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, NonRetryableError, PhoneSignatureStep, SHA256_MULTIHASH_CODE, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __chunkFailureErrorForTest, __getBulletinAuthorizationContextForTest, __selectStorageProviderModeForTest, __storeChunkForTest, __waitForChainLivenessForTest, applyManifestFetchAttributes, assertPoolFallbackAllowed, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computeClassificationPrecision, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deployActorsToSignerOptions, deriveRootSigner, describeSlotFallbackReason, detectBuildMarkers, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, extractInvalidTransactionVariant, formatStorageSignerLine, formatSubdomainParentError, formatTransferModeDotnsLine, formatTransferModeStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, isPoolFallbackAllowed, makeBulletinStatusHandler, merkleize, nonInteractivePhoneConfirmationError, partitionFinalityProbe, probeP2pRetrieval, reconcileTimedOutChunk, resolveBulletinEndpoints, resolveDotnsConnectOptions, resolveEnvId, resolveProductSigner, resolveReproducibleTimestamp, retryBudgetExhausted, selectStorageReconnect, setBulletinAuthorizationContext, setBulletinEndpoints, setWsHaltCallback, shouldHandoverName, shouldPublishManifest, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile };
package/dist/deploy.js CHANGED
@@ -26,12 +26,15 @@ import {
26
26
  checkDeploySize,
27
27
  chooseSignerInput,
28
28
  chunk,
29
+ computeClassificationPrecision,
29
30
  computePhoneSigningSteps,
30
31
  computeStorageCid,
31
32
  createCID,
32
33
  deploy,
34
+ deployActorsToSignerOptions,
33
35
  deriveRootSigner,
34
36
  describeSlotFallbackReason,
37
+ detectBuildMarkers,
35
38
  detectFramework,
36
39
  encodeContenthash,
37
40
  encryptContent,
@@ -56,7 +59,6 @@ import {
56
59
  reconcileTimedOutChunk,
57
60
  resolveBulletinEndpoints,
58
61
  resolveDotnsConnectOptions,
59
- resolveEffectiveMnemonic,
60
62
  resolveEnvId,
61
63
  resolveProductSigner,
62
64
  resolveReproducibleTimestamp,
@@ -71,36 +73,40 @@ import {
71
73
  storeDirectory,
72
74
  storeDirectoryV2,
73
75
  storeFile
74
- } from "./chunk-6MSHWNJT.js";
76
+ } from "./chunk-D6BE3RAU.js";
77
+ import "./chunk-6J4WRFRL.js";
78
+ import "./chunk-GRPLHUYC.js";
75
79
  import "./chunk-HNJWIY55.js";
76
80
  import "./chunk-M5AKL3FL.js";
77
- import "./chunk-6FQJLLEF.js";
78
- import "./chunk-GRPLHUYC.js";
79
- import "./chunk-IW3X2MJF.js";
80
- import "./chunk-LPTKBQII.js";
81
- import "./chunk-3MAIF2SF.js";
82
- import "./chunk-WPC2PUCV.js";
83
- import "./chunk-QU5GJF6U.js";
84
- import "./chunk-SNFGJOR2.js";
85
- import "./chunk-PSYA6E5M.js";
81
+ import "./chunk-D3YME2EG.js";
82
+ import "./chunk-7DDOVCV5.js";
83
+ import "./chunk-F24S4EV5.js";
84
+ import "./chunk-H44LXDQJ.js";
85
+ import "./chunk-UFP2XWZ4.js";
86
+ import "./chunk-R3BXRRKE.js";
87
+ import "./chunk-2P4EZOFF.js";
86
88
  import "./chunk-C2TS5MER.js";
87
- import "./chunk-3ACNAWUD.js";
89
+ import "./chunk-JTH3ISLR.js";
88
90
  import "./chunk-JQKKMUCT.js";
89
- import "./chunk-5FLTDWWP.js";
90
91
  import "./chunk-RIRDBSBG.js";
91
- import "./chunk-RJDHC56V.js";
92
+ import "./chunk-H44NO63C.js";
93
+ import "./chunk-ZZIOS4RG.js";
92
94
  import "./chunk-SI2ZUOYD.js";
95
+ import {
96
+ mnemonicConflictNotice,
97
+ resolveEffectiveMnemonic
98
+ } from "./chunk-ZG3HAH5A.js";
93
99
  import "./chunk-FWJQAIVO.js";
94
- import "./chunk-ABMNC34K.js";
100
+ import "./chunk-U2QO5G35.js";
95
101
  import "./chunk-TSPERKUS.js";
96
- import "./chunk-NA3SXVY6.js";
102
+ import "./chunk-3NR3T7US.js";
103
+ import "./chunk-CCIBF55X.js";
104
+ import "./chunk-BFK5UCUJ.js";
105
+ import "./chunk-OONQPYHM.js";
97
106
  import {
98
107
  EXIT_CODE_NO_RETRY,
99
108
  NonRetryableError
100
- } from "./chunk-ZOC4GITL.js";
101
- import "./chunk-VBIFKNUS.js";
102
- import "./chunk-IP6ABIIC.js";
103
- import "./chunk-KTKFHROI.js";
109
+ } from "./chunk-SH2LG52Z.js";
104
110
  import "./chunk-K5SP4OUC.js";
105
111
  export {
106
112
  BLAKE2B_256_MULTIHASH_CODE,
@@ -132,12 +138,15 @@ export {
132
138
  checkDeploySize,
133
139
  chooseSignerInput,
134
140
  chunk,
141
+ computeClassificationPrecision,
135
142
  computePhoneSigningSteps,
136
143
  computeStorageCid,
137
144
  createCID,
138
145
  deploy,
146
+ deployActorsToSignerOptions,
139
147
  deriveRootSigner,
140
148
  describeSlotFallbackReason,
149
+ detectBuildMarkers,
141
150
  detectFramework,
142
151
  encodeContenthash,
143
152
  encryptContent,
@@ -156,6 +165,7 @@ export {
156
165
  isPoolFallbackAllowed,
157
166
  makeBulletinStatusHandler,
158
167
  merkleize,
168
+ mnemonicConflictNotice,
159
169
  nonInteractivePhoneConfirmationError,
160
170
  partitionFinalityProbe,
161
171
  probeP2pRetrieval,