bulletin-deploy 0.13.2 → 0.14.0

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 (37) hide show
  1. package/dist/auth-config.js +3 -3
  2. package/dist/bug-report.js +4 -4
  3. package/dist/{chunk-TLANVKWT.js → chunk-6DMVVW7D.js} +2 -2
  4. package/dist/{chunk-RVSHGN74.js → chunk-FFFBDWBL.js} +1 -1
  5. package/dist/{chunk-3QQ3KC6Q.js → chunk-FFI2YO6N.js} +200 -70
  6. package/dist/{chunk-7PDAOD6W.js → chunk-FKQCPZAW.js} +48 -2
  7. package/dist/{chunk-2E2KHTF2.js → chunk-GKIJJAKS.js} +1 -1
  8. package/dist/{chunk-KQOQN5CN.js → chunk-GNXYXE4P.js} +1 -1
  9. package/dist/{chunk-HAFE24QD.js → chunk-HLW32ZR6.js} +3 -3
  10. package/dist/{chunk-SRCUUO5A.js → chunk-JJXKPPFL.js} +21 -8
  11. package/dist/{chunk-RRBDBTOF.js → chunk-PL3DKMZB.js} +1 -1
  12. package/dist/{chunk-64FAP55R.js → chunk-S4LRYPNK.js} +1 -1
  13. package/dist/{chunk-YKWQMXWJ.js → chunk-SDAVYGN3.js} +64 -23
  14. package/dist/chunk-probe.js +3 -3
  15. package/dist/commands/login.js +10 -10
  16. package/dist/commands/logout.js +4 -4
  17. package/dist/commands/transfer.js +3 -3
  18. package/dist/commands/whoami.js +3 -3
  19. package/dist/deploy-actors.js +5 -5
  20. package/dist/deploy.d.ts +13 -1
  21. package/dist/deploy.js +12 -10
  22. package/dist/dotns.d.ts +35 -4
  23. package/dist/dotns.js +11 -3
  24. package/dist/index.js +11 -11
  25. package/dist/manifest/publish.d.ts +41 -1
  26. package/dist/manifest/publish.js +15 -13
  27. package/dist/memory-report.js +2 -2
  28. package/dist/merkle.js +10 -10
  29. package/dist/personhood/bootstrap.js +3 -3
  30. package/dist/personhood/people-client.js +3 -3
  31. package/dist/run-state.js +1 -1
  32. package/dist/sss-allowance-cache.js +4 -4
  33. package/dist/storage-signer.js +10 -10
  34. package/dist/telemetry.d.ts +3 -2
  35. package/dist/telemetry.js +4 -2
  36. package/dist/version-check.js +3 -3
  37. package/package.json +1 -1
@@ -9,10 +9,16 @@ import {
9
9
  setBulletinEndpoints,
10
10
  storeDirectory,
11
11
  storeFile
12
- } from "./chunk-SRCUUO5A.js";
12
+ } from "./chunk-JJXKPPFL.js";
13
13
  import {
14
- DotNS
15
- } from "./chunk-3QQ3KC6Q.js";
14
+ DotNS,
15
+ TX_KIND_SKIPPED
16
+ } from "./chunk-FFI2YO6N.js";
17
+ import {
18
+ setDeployAttribute,
19
+ withManifestSpan,
20
+ withSpan
21
+ } from "./chunk-FKQCPZAW.js";
16
22
  import {
17
23
  DEFAULT_ENV_ID,
18
24
  getPopSelfServeConfig,
@@ -40,19 +46,29 @@ async function publishManifest(opts) {
40
46
  `Manifest size preflight failed: ${failing}. Shrink displayName / description / paths or override BULLETIN_TEXT_BUDGET.`
41
47
  );
42
48
  }
49
+ return withManifestSpan(config.domain, () => publishManifestBody(opts, config, sourcePath));
50
+ }
51
+ async function publishManifestBody(opts, config, sourcePath) {
43
52
  const configDir = path.dirname(sourcePath);
44
53
  const envId = opts.env ?? DEFAULT_ENV_ID;
45
54
  const { doc } = await loadEnvironments();
46
55
  const resolved = resolveEndpoints(doc, envId);
47
56
  const popSelfServe = getPopSelfServeConfig(doc, envId);
48
57
  setBulletinEndpoints(resolveBulletinEndpoints(resolved.bulletin, opts.rpc));
58
+ setDeployAttribute("deploy.manifest.executable_count", String(config.executables.length));
49
59
  const iconAbs = path.resolve(configDir, config.icon.path);
50
60
  const iconBytes = await readFileOrThrow(iconAbs, "icon");
51
61
  console.log(`
52
62
  Manifest publish \u2014 ${config.domain}`);
53
63
  console.log(` Loaded config: ${sourcePath}`);
54
64
  console.log(` Uploading icon (${iconBytes.length} B)\u2026`);
55
- const iconCid = await storeFile(iconBytes, { hashCode: BLAKE2B_256_MULTIHASH_CODE });
65
+ setDeployAttribute("deploy.manifest.icon_bytes", String(iconBytes.length));
66
+ const iconCid = await withSpan(
67
+ "deploy.manifest.icon-upload",
68
+ "manifest icon upload",
69
+ { "deploy.manifest.icon_bytes": String(iconBytes.length) },
70
+ () => storeFile(iconBytes, { hashCode: BLAKE2B_256_MULTIHASH_CODE })
71
+ );
56
72
  console.log(` Icon CID: ${iconCid}`);
57
73
  const executableCids = {};
58
74
  for (const exec of config.executables) {
@@ -74,37 +90,61 @@ Manifest publish \u2014 ${config.domain}`);
74
90
  const rootManifest = composeRoot(config, iconCid);
75
91
  const rootJson = JSON.stringify(rootManifest);
76
92
  console.log(` Writing root manifest text record on ${config.domain} (${Buffer.byteLength(rootJson, "utf8")} B)\u2026`);
77
- await dotns.setTextRecord(baseLabel, "manifest", rootJson);
93
+ const rootTextRes = await dotns.setTextRecord(baseLabel, "manifest", rootJson);
94
+ let recordsWritten = 0;
95
+ let recordsSkipped = 0;
96
+ let subnamesRegistered = 0;
97
+ if (rootTextRes.txHash === TX_KIND_SKIPPED) recordsSkipped++;
98
+ else recordsWritten++;
78
99
  let textRecordsWritten = 1;
79
100
  for (const exec of config.executables) {
80
101
  const cid = executableCids[exec.kind];
81
102
  if (!cid) throw new NonRetryableError(`Internal: missing CID for executable kind '${exec.kind}'`);
82
- const ownership = await dotns.checkSubdomainOwnership(exec.kind, baseLabel);
83
- if (!ownership.owned) {
84
- if (ownership.owner) {
85
- throw new NonRetryableError(
86
- `Subname ${exec.kind}.${config.domain} is owned by ${ownership.owner}, not the publisher. Aborting.`
87
- );
103
+ await withSpan(
104
+ "deploy.manifest.executable",
105
+ `manifest executable ${exec.kind}`,
106
+ { "deploy.manifest.executable_kind": exec.kind },
107
+ async () => {
108
+ const ownership = await dotns.checkSubdomainOwnership(exec.kind, baseLabel);
109
+ const { registered } = await registerOrEnsureResolver(dotns, ownership, exec.kind, baseLabel, config.domain);
110
+ if (registered) subnamesRegistered++;
111
+ const subContenthash = `0x${encodeContenthash(cid)}`;
112
+ console.log(` Setting contenthash on ${exec.kind}.${config.domain} \u2192 ${cid}\u2026`);
113
+ const contenthashRes = await dotns.setContenthash(`${exec.kind}.${baseLabel}`, subContenthash);
114
+ if (contenthashRes.skipped) recordsSkipped++;
115
+ const execManifest = composeExecutable(exec);
116
+ const execJson = JSON.stringify(execManifest);
117
+ console.log(` Writing executable manifest on ${exec.kind}.${config.domain} (${Buffer.byteLength(execJson, "utf8")} B)\u2026`);
118
+ const execTextRes = await dotns.setTextRecord(`${exec.kind}.${baseLabel}`, "executable", execJson);
119
+ if (execTextRes.txHash === TX_KIND_SKIPPED) recordsSkipped++;
120
+ else recordsWritten++;
88
121
  }
89
- console.log(` Registering subname ${exec.kind}.${config.domain}\u2026`);
90
- await dotns.registerSubdomain(exec.kind, baseLabel);
91
- }
92
- await dotns.ensureContentResolver(`${exec.kind}.${baseLabel}`);
93
- const subContenthash = `0x${encodeContenthash(cid)}`;
94
- console.log(` Setting contenthash on ${exec.kind}.${config.domain} \u2192 ${cid}\u2026`);
95
- await dotns.setContenthash(`${exec.kind}.${baseLabel}`, subContenthash);
96
- const execManifest = composeExecutable(exec);
97
- const execJson = JSON.stringify(execManifest);
98
- console.log(` Writing executable manifest on ${exec.kind}.${config.domain} (${Buffer.byteLength(execJson, "utf8")} B)\u2026`);
99
- await dotns.setTextRecord(`${exec.kind}.${baseLabel}`, "executable", execJson);
122
+ );
100
123
  textRecordsWritten++;
101
124
  }
125
+ setDeployAttribute("deploy.manifest.text_records_written", String(recordsWritten));
126
+ setDeployAttribute("deploy.manifest.text_records_skipped", String(recordsSkipped));
127
+ setDeployAttribute("deploy.manifest.subnames_registered", String(subnamesRegistered));
102
128
  console.log(` \u2713 ${textRecordsWritten} text record${textRecordsWritten === 1 ? "" : "s"} written.`);
103
129
  return { iconCid, executableCids, textRecordsWritten };
104
130
  } finally {
105
131
  dotns.disconnect();
106
132
  }
107
133
  }
134
+ async function registerOrEnsureResolver(dotns, ownership, execKind, baseLabel, domain) {
135
+ if (!ownership.owned) {
136
+ if (ownership.owner) {
137
+ throw new NonRetryableError(
138
+ `Subname ${execKind}.${domain} is owned by ${ownership.owner}, not the publisher. Aborting.`
139
+ );
140
+ }
141
+ console.log(` Registering subname ${execKind}.${domain}\u2026`);
142
+ await dotns.registerSubdomain(execKind, baseLabel);
143
+ return { registered: true };
144
+ }
145
+ await dotns.ensureContentResolver(`${execKind}.${baseLabel}`);
146
+ return { registered: false };
147
+ }
108
148
  async function readFileOrThrow(p, label) {
109
149
  try {
110
150
  return await fs.readFile(p);
@@ -165,5 +205,6 @@ function stripDotSuffix(domain) {
165
205
  }
166
206
 
167
207
  export {
168
- publishManifest
208
+ publishManifest,
209
+ registerOrEnsureResolver
169
210
  };
@@ -8,9 +8,9 @@ import {
8
8
  getBestBlockNumber,
9
9
  probeChunks,
10
10
  probeFinalityGap
11
- } from "./chunk-64FAP55R.js";
12
- import "./chunk-7PDAOD6W.js";
13
- import "./chunk-KQOQN5CN.js";
11
+ } from "./chunk-S4LRYPNK.js";
12
+ import "./chunk-FKQCPZAW.js";
13
+ import "./chunk-GNXYXE4P.js";
14
14
  export {
15
15
  ChainProbeCrossValidationError,
16
16
  ChainProbeMetadataError,
@@ -3,10 +3,10 @@ import {
3
3
  } from "../chunk-J7CYVTAW.js";
4
4
  import {
5
5
  waitForBulletinAuthorization
6
- } from "../chunk-SRCUUO5A.js";
6
+ } from "../chunk-JJXKPPFL.js";
7
7
  import {
8
8
  preflightSssAllowance
9
- } from "../chunk-2E2KHTF2.js";
9
+ } from "../chunk-GKIJJAKS.js";
10
10
  import {
11
11
  statementSigningAccount
12
12
  } from "../chunk-GRPLHUYC.js";
@@ -15,11 +15,11 @@ import "../chunk-IW3X2MJF.js";
15
15
  import "../chunk-KOSF5FDO.js";
16
16
  import "../chunk-J3NIXHZZ.js";
17
17
  import "../chunk-S7EM5VMW.js";
18
- import "../chunk-HAFE24QD.js";
19
- import "../chunk-RRBDBTOF.js";
20
- import "../chunk-64FAP55R.js";
18
+ import "../chunk-HLW32ZR6.js";
19
+ import "../chunk-PL3DKMZB.js";
20
+ import "../chunk-S4LRYPNK.js";
21
21
  import "../chunk-C2TS5MER.js";
22
- import "../chunk-TLANVKWT.js";
22
+ import "../chunk-6DMVVW7D.js";
23
23
  import "../chunk-JQKKMUCT.js";
24
24
  import {
25
25
  BULLETIN_RESOURCE,
@@ -36,15 +36,15 @@ import {
36
36
  getAuthClient,
37
37
  getPeopleChainEndpoints,
38
38
  resolveBulletinEndpoints
39
- } from "../chunk-RVSHGN74.js";
39
+ } from "../chunk-FFFBDWBL.js";
40
40
  import {
41
41
  CLI_NAME
42
42
  } from "../chunk-TSPERKUS.js";
43
- import "../chunk-3QQ3KC6Q.js";
43
+ import "../chunk-FFI2YO6N.js";
44
44
  import "../chunk-SI2ZUOYD.js";
45
45
  import "../chunk-4AEFFDHP.js";
46
- import "../chunk-7PDAOD6W.js";
47
- import "../chunk-KQOQN5CN.js";
46
+ import "../chunk-FKQCPZAW.js";
47
+ import "../chunk-GNXYXE4P.js";
48
48
  import {
49
49
  loadEnvironments
50
50
  } from "../chunk-3ZEMX4WD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearSssAllowanceCache
3
- } from "../chunk-2E2KHTF2.js";
3
+ } from "../chunk-GKIJJAKS.js";
4
4
  import "../chunk-GRPLHUYC.js";
5
5
  import "../chunk-JQKKMUCT.js";
6
6
  import "../chunk-5FLTDWWP.js";
@@ -9,10 +9,10 @@ import {
9
9
  } from "../chunk-RIRDBSBG.js";
10
10
  import {
11
11
  getAuthClient
12
- } from "../chunk-RVSHGN74.js";
12
+ } from "../chunk-FFFBDWBL.js";
13
13
  import "../chunk-TSPERKUS.js";
14
- import "../chunk-7PDAOD6W.js";
15
- import "../chunk-KQOQN5CN.js";
14
+ import "../chunk-FKQCPZAW.js";
15
+ import "../chunk-GNXYXE4P.js";
16
16
  import "../chunk-3ZEMX4WD.js";
17
17
  import "../chunk-ZOC4GITL.js";
18
18
 
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  DEFAULT_MNEMONIC,
6
6
  DotNS
7
- } from "../chunk-3QQ3KC6Q.js";
7
+ } from "../chunk-FFI2YO6N.js";
8
8
  import "../chunk-SI2ZUOYD.js";
9
9
  import "../chunk-4AEFFDHP.js";
10
- import "../chunk-7PDAOD6W.js";
11
- import "../chunk-KQOQN5CN.js";
10
+ import "../chunk-FKQCPZAW.js";
11
+ import "../chunk-GNXYXE4P.js";
12
12
  import {
13
13
  getPopSelfServeConfig,
14
14
  loadEnvironments,
@@ -2,12 +2,12 @@ import {
2
2
  STALE_SESSION_MESSAGE,
3
3
  getAuthClient,
4
4
  hasPersistedSession
5
- } from "../chunk-RVSHGN74.js";
5
+ } from "../chunk-FFFBDWBL.js";
6
6
  import {
7
7
  CLI_NAME
8
8
  } from "../chunk-TSPERKUS.js";
9
- import "../chunk-7PDAOD6W.js";
10
- import "../chunk-KQOQN5CN.js";
9
+ import "../chunk-FKQCPZAW.js";
10
+ import "../chunk-GNXYXE4P.js";
11
11
  import "../chunk-3ZEMX4WD.js";
12
12
  import "../chunk-ZOC4GITL.js";
13
13
 
@@ -2,17 +2,17 @@ import {
2
2
  MainnetDefaultWorkerError,
3
3
  resolveDeployActors,
4
4
  resolveStorageSigner
5
- } from "./chunk-TLANVKWT.js";
5
+ } from "./chunk-6DMVVW7D.js";
6
6
  import "./chunk-JQKKMUCT.js";
7
7
  import "./chunk-5FLTDWWP.js";
8
8
  import "./chunk-RIRDBSBG.js";
9
- import "./chunk-RVSHGN74.js";
9
+ import "./chunk-FFFBDWBL.js";
10
10
  import "./chunk-TSPERKUS.js";
11
- import "./chunk-3QQ3KC6Q.js";
11
+ import "./chunk-FFI2YO6N.js";
12
12
  import "./chunk-SI2ZUOYD.js";
13
13
  import "./chunk-4AEFFDHP.js";
14
- import "./chunk-7PDAOD6W.js";
15
- import "./chunk-KQOQN5CN.js";
14
+ import "./chunk-FKQCPZAW.js";
15
+ import "./chunk-GNXYXE4P.js";
16
16
  import "./chunk-3ZEMX4WD.js";
17
17
  import "./chunk-ZOC4GITL.js";
18
18
  export {
package/dist/deploy.d.ts CHANGED
@@ -538,6 +538,18 @@ declare function assertSubdomainOwnerMatchesSigner(result: {
538
538
  owned: boolean;
539
539
  owner: string | null | undefined;
540
540
  }, signerEvmAddress: string | null | undefined, sublabel: string, parentLabel: string): void;
541
+ /**
542
+ * Issue #1185: an unregistered, non-registrable parent (a governance-reserved
543
+ * name) used to yield "parent game.dot is owned by no one, not by this
544
+ * signer" — awkward, and silent about the only route forward. When the
545
+ * parent is non-registrable per classifyRegistrability AND unowned, this
546
+ * additionally teaches the dotns-cli whitelisted-registration route, via the
547
+ * SAME formatUnregistrableReason preflight/register() use, so the texts
548
+ * cannot drift. Owned-by-another-account keeps the original message
549
+ * unchanged — that case is about ownership, not registrability, and must
550
+ * NOT suggest registering a name someone else already holds.
551
+ */
552
+ declare function formatSubdomainParentError(fullName: string, parentLabel: string, parentOwner: string | null, selfAddress: string): string;
541
553
  declare function unpublish(domainName: string, options?: {
542
554
  mnemonic?: string;
543
555
  derivationPath?: string;
@@ -604,4 +616,4 @@ declare function computePhoneSigningSteps(dotnsPreflight: {
604
616
  needsPopUpgrade: boolean;
605
617
  } | null, publishNeeded: boolean): string[];
606
618
 
607
- export { BLAKE2B_256_MULTIHASH_CODE, BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, 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, PhoneSignatureStep, SHA256_MULTIHASH_CODE, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __selectStorageProviderModeForTest, __waitForChainLivenessForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deriveRootSigner, describeSlotFallbackReason, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, formatStorageSignerLine, formatTransferModeDotnsLine, formatTransferModeStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, makeBulletinStatusHandler, merkleize, probeP2pRetrieval, reconcileTimedOutChunk, resolveBulletinEndpoints, resolveDotnsConnectOptions, resolveEffectiveMnemonic, resolveEnvId, resolveReproducibleTimestamp, retryBudgetExhausted, setBulletinEndpoints, setWsHaltCallback, shouldHandoverName, shouldPublishManifest, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish, validateNoManifestFlags };
619
+ export { BLAKE2B_256_MULTIHASH_CODE, BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, 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, PhoneSignatureStep, SHA256_MULTIHASH_CODE, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __selectStorageProviderModeForTest, __waitForChainLivenessForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deriveRootSigner, describeSlotFallbackReason, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, formatStorageSignerLine, formatSubdomainParentError, formatTransferModeDotnsLine, formatTransferModeStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, makeBulletinStatusHandler, merkleize, probeP2pRetrieval, reconcileTimedOutChunk, resolveBulletinEndpoints, resolveDotnsConnectOptions, resolveEffectiveMnemonic, resolveEnvId, resolveReproducibleTimestamp, retryBudgetExhausted, setBulletinEndpoints, setWsHaltCallback, shouldHandoverName, shouldPublishManifest, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish, validateNoManifestFlags };
package/dist/deploy.js CHANGED
@@ -33,6 +33,7 @@ import {
33
33
  encryptContent,
34
34
  estimateUploadBytes,
35
35
  formatStorageSignerLine,
36
+ formatSubdomainParentError,
36
37
  formatTransferModeDotnsLine,
37
38
  formatTransferModeStorageSignerLine,
38
39
  friendlyChainError,
@@ -61,29 +62,29 @@ import {
61
62
  storeFile,
62
63
  unpublish,
63
64
  validateNoManifestFlags
64
- } from "./chunk-SRCUUO5A.js";
65
- import "./chunk-2E2KHTF2.js";
65
+ } from "./chunk-JJXKPPFL.js";
66
+ import "./chunk-GKIJJAKS.js";
66
67
  import "./chunk-GRPLHUYC.js";
67
68
  import "./chunk-HOTQDYHD.js";
68
69
  import "./chunk-IW3X2MJF.js";
69
70
  import "./chunk-KOSF5FDO.js";
70
71
  import "./chunk-J3NIXHZZ.js";
71
72
  import "./chunk-S7EM5VMW.js";
72
- import "./chunk-HAFE24QD.js";
73
- import "./chunk-RRBDBTOF.js";
74
- import "./chunk-64FAP55R.js";
73
+ import "./chunk-HLW32ZR6.js";
74
+ import "./chunk-PL3DKMZB.js";
75
+ import "./chunk-S4LRYPNK.js";
75
76
  import "./chunk-C2TS5MER.js";
76
- import "./chunk-TLANVKWT.js";
77
+ import "./chunk-6DMVVW7D.js";
77
78
  import "./chunk-JQKKMUCT.js";
78
79
  import "./chunk-5FLTDWWP.js";
79
80
  import "./chunk-RIRDBSBG.js";
80
- import "./chunk-RVSHGN74.js";
81
+ import "./chunk-FFFBDWBL.js";
81
82
  import "./chunk-TSPERKUS.js";
82
- import "./chunk-3QQ3KC6Q.js";
83
+ import "./chunk-FFI2YO6N.js";
83
84
  import "./chunk-SI2ZUOYD.js";
84
85
  import "./chunk-4AEFFDHP.js";
85
- import "./chunk-7PDAOD6W.js";
86
- import "./chunk-KQOQN5CN.js";
86
+ import "./chunk-FKQCPZAW.js";
87
+ import "./chunk-GNXYXE4P.js";
87
88
  import "./chunk-3ZEMX4WD.js";
88
89
  import {
89
90
  EXIT_CODE_NO_RETRY,
@@ -126,6 +127,7 @@ export {
126
127
  encryptContent,
127
128
  estimateUploadBytes,
128
129
  formatStorageSignerLine,
130
+ formatSubdomainParentError,
129
131
  formatTransferModeDotnsLine,
130
132
  formatTransferModeStorageSignerLine,
131
133
  friendlyChainError,
package/dist/dotns.d.ts CHANGED
@@ -407,10 +407,40 @@ declare function computeDomainTokenId(label: string): bigint;
407
407
  declare function countTrailingDigits(label: string): number;
408
408
  declare function stripTrailingDigits(label: string): string;
409
409
  declare function sanitizeDomainLabel(label: string): string;
410
- declare function validateDomainLabel(label: string, opts?: {
411
- checkReserved?: boolean;
412
- skipSanitize?: boolean;
410
+ interface DomainLabelAlternative {
411
+ label: string;
412
+ baseLength: number;
413
+ status: number;
414
+ tierDescription: string;
415
+ }
416
+ declare function buildLabelAlternatives(label: string): DomainLabelAlternative[];
417
+ type Registrability = {
418
+ registrable: true;
419
+ } | {
420
+ registrable: false;
421
+ rule: "reserved-base" | "trailing-digits" | "hyphen-base";
422
+ message: string;
423
+ };
424
+ declare function classifyRegistrability(label: string): Registrability;
425
+ declare function formatUnregistrableReason(args: {
426
+ label: string;
427
+ registrability: Extract<Registrability, {
428
+ registrable: false;
429
+ }>;
430
+ existingOwner: string | null;
431
+ selfAddress: string;
413
432
  }): string;
433
+ declare function decideRegistrabilityOutcome(args: {
434
+ label: string;
435
+ registrability: Registrability;
436
+ existingOwner: string | null;
437
+ selfAddress: string;
438
+ }): {
439
+ canProceed: boolean;
440
+ plannedAction: "already-owned-by-us" | "register" | "abort";
441
+ reason?: string;
442
+ };
443
+ declare function validateDomainLabel(label: string): string;
414
444
  declare function isCommitmentMature(chainNowSeconds: number, commitTimestampSeconds: number, minimumAgeSeconds: number): boolean;
415
445
  declare function isCommitmentTimingBarerevert(msg: string): boolean;
416
446
  declare function classifyDotnsLabel(label: string): {
@@ -675,6 +705,7 @@ declare class DotNS {
675
705
  feeAsset?: "pgas";
676
706
  }): Promise<{
677
707
  node: string;
708
+ skipped: boolean;
678
709
  }>;
679
710
  /**
680
711
  * Point a node's registered resolver at `DOTNS_CONTENT_RESOLVER` (RFC §Step 3.2).
@@ -786,4 +817,4 @@ declare class DotNS {
786
817
  }
787
818
  declare const dotns: DotNS;
788
819
 
789
- export { ATTR_TX_RESOLUTION_KIND, type AliasAccountClassification, type AliasAccountState, CONNECTION_TIMEOUT_MS, CONTENTHASH_VERIFY_ATTEMPTS, CONTRACTS, ContractDryRunRevertError, DECIMALS, DEFAULT_MNEMONIC, DOTNS_BEST_BLOCK_GRACE_MS, DOTNS_NONCE_CONTENTION_MAX_ATTEMPTS, DOTNS_TX_MAX_ATTEMPTS, DOT_NODE, DotNS, type DotNSConnectOptions, type DotnsPreflightResult, type DotnsSuccessAction, MINIMUM_REGISTER_STORAGE_DEPOSIT, NATIVE_TO_ETH_RATIO, NONCE_ADVANCE_VERIFY_RETRIES, NONCE_ADVANCE_VERIFY_RETRY_INTERVAL_MS, OPERATION_TIMEOUT_MS, type OwnershipResult, PUBLISHER_ABI, type ParsedDomainName, type PhoneSignatureStep, type PriceValidationResult, ProofOfPersonhoodStatus, PublisherNotSupportedError, REVIVE_ADDRESS_ATTEMPTS, RPC_ENDPOINTS, ReviveClientWrapper, TX_CHAIN_TIME_BUDGET_MS, TX_KIND_BEST_BLOCK, TX_KIND_HASH, TX_KIND_NONCE_ADVANCED, TX_KIND_SKIPPED, TX_NO_PROGRESS_MS, TX_TIMEOUT_MS, TX_WALL_CLOCK_CEILING_MS, type TxResolution, VERIFY_EFFECT_CHAIN_SECONDS, WS_HEARTBEAT_TIMEOUT_MS, WatcherSilentNoEventError, __formatContractDryRunFailureForTest, bufferedWeiToNative, canRegister, classifyAliasAccountRow, classifyDotnsLabel, classifyTxRetryDecision, classifyWatcherSilentFastFail, computeDomainTokenId, convertToHexString, convertWeiToNative, countTrailingDigits, decodePublisherRevert, dotns, dotnsRetryBackoffMs, feeFloorFor, fetchNonce, fmtPas, formatDispatchError, formatPersonhoodRemediation, formatPopShortfallReason, isCommitmentMature, isCommitmentTimingBarerevert, isNonceContentionAmbiguous, makeRetryStatusFilter, nonceContentionBackoffMs, parseDomainName, parseProofOfPersonhoodStatus, pickVerifyEndpoint, popStatusName, reacquireNonceOnContention, registerDepositWei, sanitizeDomainLabel, shouldRegateBeforeResign, shouldRetryTxAttempt, shouldSkipTextWrite, stripTrailingDigits, validateDomainLabel, verifyEffectWithGrace, verifyNonceAdvanced, weiToNative, withRetry };
820
+ export { ATTR_TX_RESOLUTION_KIND, type AliasAccountClassification, type AliasAccountState, CONNECTION_TIMEOUT_MS, CONTENTHASH_VERIFY_ATTEMPTS, CONTRACTS, ContractDryRunRevertError, DECIMALS, DEFAULT_MNEMONIC, DOTNS_BEST_BLOCK_GRACE_MS, DOTNS_NONCE_CONTENTION_MAX_ATTEMPTS, DOTNS_TX_MAX_ATTEMPTS, DOT_NODE, type DomainLabelAlternative, DotNS, type DotNSConnectOptions, type DotnsPreflightResult, type DotnsSuccessAction, MINIMUM_REGISTER_STORAGE_DEPOSIT, NATIVE_TO_ETH_RATIO, NONCE_ADVANCE_VERIFY_RETRIES, NONCE_ADVANCE_VERIFY_RETRY_INTERVAL_MS, OPERATION_TIMEOUT_MS, type OwnershipResult, PUBLISHER_ABI, type ParsedDomainName, type PhoneSignatureStep, type PriceValidationResult, ProofOfPersonhoodStatus, PublisherNotSupportedError, REVIVE_ADDRESS_ATTEMPTS, RPC_ENDPOINTS, type Registrability, ReviveClientWrapper, TX_CHAIN_TIME_BUDGET_MS, TX_KIND_BEST_BLOCK, TX_KIND_HASH, TX_KIND_NONCE_ADVANCED, TX_KIND_SKIPPED, TX_NO_PROGRESS_MS, TX_TIMEOUT_MS, TX_WALL_CLOCK_CEILING_MS, type TxResolution, VERIFY_EFFECT_CHAIN_SECONDS, WS_HEARTBEAT_TIMEOUT_MS, WatcherSilentNoEventError, __formatContractDryRunFailureForTest, bufferedWeiToNative, buildLabelAlternatives, canRegister, classifyAliasAccountRow, classifyDotnsLabel, classifyRegistrability, classifyTxRetryDecision, classifyWatcherSilentFastFail, computeDomainTokenId, convertToHexString, convertWeiToNative, countTrailingDigits, decideRegistrabilityOutcome, decodePublisherRevert, dotns, dotnsRetryBackoffMs, feeFloorFor, fetchNonce, fmtPas, formatDispatchError, formatPersonhoodRemediation, formatPopShortfallReason, formatUnregistrableReason, isCommitmentMature, isCommitmentTimingBarerevert, isNonceContentionAmbiguous, makeRetryStatusFilter, nonceContentionBackoffMs, parseDomainName, parseProofOfPersonhoodStatus, pickVerifyEndpoint, popStatusName, reacquireNonceOnContention, registerDepositWei, sanitizeDomainLabel, shouldRegateBeforeResign, shouldRetryTxAttempt, shouldSkipTextWrite, stripTrailingDigits, validateDomainLabel, verifyEffectWithGrace, verifyNonceAdvanced, weiToNative, withRetry };
package/dist/dotns.js CHANGED
@@ -35,15 +35,18 @@ import {
35
35
  WatcherSilentNoEventError,
36
36
  __formatContractDryRunFailureForTest,
37
37
  bufferedWeiToNative,
38
+ buildLabelAlternatives,
38
39
  canRegister,
39
40
  classifyAliasAccountRow,
40
41
  classifyDotnsLabel,
42
+ classifyRegistrability,
41
43
  classifyTxRetryDecision,
42
44
  classifyWatcherSilentFastFail,
43
45
  computeDomainTokenId,
44
46
  convertToHexString,
45
47
  convertWeiToNative,
46
48
  countTrailingDigits,
49
+ decideRegistrabilityOutcome,
47
50
  decodePublisherRevert,
48
51
  dotns,
49
52
  dotnsRetryBackoffMs,
@@ -53,6 +56,7 @@ import {
53
56
  formatDispatchError,
54
57
  formatPersonhoodRemediation,
55
58
  formatPopShortfallReason,
59
+ formatUnregistrableReason,
56
60
  isCommitmentMature,
57
61
  isCommitmentTimingBarerevert,
58
62
  isNonceContentionAmbiguous,
@@ -74,11 +78,11 @@ import {
74
78
  verifyNonceAdvanced,
75
79
  weiToNative,
76
80
  withRetry
77
- } from "./chunk-3QQ3KC6Q.js";
81
+ } from "./chunk-FFI2YO6N.js";
78
82
  import "./chunk-SI2ZUOYD.js";
79
83
  import "./chunk-4AEFFDHP.js";
80
- import "./chunk-7PDAOD6W.js";
81
- import "./chunk-KQOQN5CN.js";
84
+ import "./chunk-FKQCPZAW.js";
85
+ import "./chunk-GNXYXE4P.js";
82
86
  import "./chunk-3ZEMX4WD.js";
83
87
  import "./chunk-ZOC4GITL.js";
84
88
  export {
@@ -118,15 +122,18 @@ export {
118
122
  WatcherSilentNoEventError,
119
123
  __formatContractDryRunFailureForTest,
120
124
  bufferedWeiToNative,
125
+ buildLabelAlternatives,
121
126
  canRegister,
122
127
  classifyAliasAccountRow,
123
128
  classifyDotnsLabel,
129
+ classifyRegistrability,
124
130
  classifyTxRetryDecision,
125
131
  classifyWatcherSilentFastFail,
126
132
  computeDomainTokenId,
127
133
  convertToHexString,
128
134
  convertWeiToNative,
129
135
  countTrailingDigits,
136
+ decideRegistrabilityOutcome,
130
137
  decodePublisherRevert,
131
138
  dotns,
132
139
  dotnsRetryBackoffMs,
@@ -136,6 +143,7 @@ export {
136
143
  formatDispatchError,
137
144
  formatPersonhoodRemediation,
138
145
  formatPopShortfallReason,
146
+ formatUnregistrableReason,
139
147
  isCommitmentMature,
140
148
  isCommitmentTimingBarerevert,
141
149
  isNonceContentionAmbiguous,
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-U2SZ3ZRI.js";
6
6
  import {
7
7
  publishManifest
8
- } from "./chunk-YKWQMXWJ.js";
8
+ } from "./chunk-SDAVYGN3.js";
9
9
  import {
10
10
  DEFAULT_TEXT_RECORD_BUDGET_BYTES,
11
11
  PLACEHOLDER_CID,
@@ -25,8 +25,8 @@ import {
25
25
  deploy,
26
26
  merkleizeJS,
27
27
  merkleizeWithStableOrder
28
- } from "./chunk-SRCUUO5A.js";
29
- import "./chunk-2E2KHTF2.js";
28
+ } from "./chunk-JJXKPPFL.js";
29
+ import "./chunk-GKIJJAKS.js";
30
30
  import "./chunk-GRPLHUYC.js";
31
31
  import "./chunk-HOTQDYHD.js";
32
32
  import {
@@ -50,24 +50,24 @@ import {
50
50
  isVolatilePath,
51
51
  parseManifest
52
52
  } from "./chunk-S7EM5VMW.js";
53
- import "./chunk-HAFE24QD.js";
54
- import "./chunk-RRBDBTOF.js";
53
+ import "./chunk-HLW32ZR6.js";
54
+ import "./chunk-PL3DKMZB.js";
55
55
  import {
56
56
  probeChunks
57
- } from "./chunk-64FAP55R.js";
57
+ } from "./chunk-S4LRYPNK.js";
58
58
  import "./chunk-C2TS5MER.js";
59
- import "./chunk-TLANVKWT.js";
59
+ import "./chunk-6DMVVW7D.js";
60
60
  import "./chunk-JQKKMUCT.js";
61
61
  import "./chunk-5FLTDWWP.js";
62
62
  import "./chunk-RIRDBSBG.js";
63
- import "./chunk-RVSHGN74.js";
63
+ import "./chunk-FFFBDWBL.js";
64
64
  import "./chunk-TSPERKUS.js";
65
65
  import {
66
66
  DEFAULT_MNEMONIC,
67
67
  DotNS,
68
68
  parseDomainName,
69
69
  sanitizeDomainLabel
70
- } from "./chunk-3QQ3KC6Q.js";
70
+ } from "./chunk-FFI2YO6N.js";
71
71
  import "./chunk-SI2ZUOYD.js";
72
72
  import {
73
73
  BULLETIN_BLOCKS_PER_DAY,
@@ -83,7 +83,7 @@ import {
83
83
  poolAccountDerivationPath,
84
84
  selectAccount
85
85
  } from "./chunk-4AEFFDHP.js";
86
- import "./chunk-7PDAOD6W.js";
86
+ import "./chunk-FKQCPZAW.js";
87
87
  import {
88
88
  VERSION,
89
89
  loadRunState,
@@ -93,7 +93,7 @@ import {
93
93
  shouldSkipStaleWarning,
94
94
  stateFilePath,
95
95
  writeRunState
96
- } from "./chunk-KQOQN5CN.js";
96
+ } from "./chunk-GNXYXE4P.js";
97
97
  import {
98
98
  DEFAULT_ENV_ID,
99
99
  deepMergeEnvironments,
@@ -1,4 +1,13 @@
1
+ import { OwnershipResult } from '../dotns.js';
1
2
  import { LoadedProductConfig } from './config-load.js';
3
+ import '../personhood/bootstrap.js';
4
+ import 'polkadot-api';
5
+ import '../personhood/bind-personal-id.js';
6
+ import '../personhood/claim-pgas.js';
7
+ import '../personhood/bind-paid-alias.js';
8
+ import '../personhood/chain-prereqs.js';
9
+ import '../environments.js';
10
+ import '../errors.js';
2
11
  import './types.js';
3
12
 
4
13
  /**
@@ -52,7 +61,38 @@ interface PublishManifestResult {
52
61
  * then writes the root + per-executable text records on dotNS. Subnames
53
62
  * (`app|widget|worker.<domain>`) are created on demand and pointed at the
54
63
  * content resolver before any `setText`.
64
+ *
65
+ * #1187: the whole body (icon/executable upload + DotNS writes) runs inside
66
+ * `withManifestSpan`, which gives this phase its own Sentry root span. Without
67
+ * it, `setDeployAttribute` calls here (and #1158's
68
+ * `deploy.dotns.nonce_contention_retries`, which fires from inside
69
+ * setContenthash/setTextRecord's shared-signer retry path) silently no-op —
70
+ * `deployRootSpan` is null once `deploy()` has already returned, which it has
71
+ * by the time bin/bulletin-deploy calls publishManifest.
55
72
  */
56
73
  declare function publishManifest(opts: PublishManifestOptions): Promise<PublishManifestResult>;
74
+ /**
75
+ * #1187 perf win: `registerSubdomain` already sets the fresh subname's
76
+ * resolver to the content resolver atomically (`setSubnodeOwner` +
77
+ * `setResolver`, batched via `Utility.batch_all` — see dotns.ts
78
+ * `registerSubdomain`). Calling `ensureContentResolver` again right after a
79
+ * fresh register was therefore a wasted chain read on every executable of
80
+ * every fresh deploy. Only the already-owned path still needs it — a
81
+ * pre-existing subname can have a stale or unset resolver.
82
+ *
83
+ * Takes a minimal injectable `dotns`-like interface (rather than the
84
+ * concrete `DotNS` class) purely so this branch can be unit-tested without a
85
+ * live chain connection; `publishManifestBody` always calls it with a real
86
+ * `DotNS` instance.
87
+ */
88
+ interface RegisterOrEnsureResolverDeps {
89
+ registerSubdomain(sublabel: string, parentLabel: string): Promise<unknown>;
90
+ ensureContentResolver(domainName: string): Promise<{
91
+ changed: boolean;
92
+ }>;
93
+ }
94
+ declare function registerOrEnsureResolver(dotns: RegisterOrEnsureResolverDeps, ownership: OwnershipResult, execKind: string, baseLabel: string, domain: string): Promise<{
95
+ registered: boolean;
96
+ }>;
57
97
 
58
- export { type PublishManifestOptions, type PublishManifestResult, publishManifest };
98
+ export { type PublishManifestOptions, type PublishManifestResult, type RegisterOrEnsureResolverDeps, publishManifest, registerOrEnsureResolver };