bulletin-deploy 0.7.3 → 0.7.5

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.
@@ -2,11 +2,11 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-MDYSENTW.js";
5
+ } from "./chunk-XOKNNK6E.js";
6
6
  import {
7
7
  VERSION,
8
8
  getCurrentSentryTraceId
9
- } from "./chunk-BYIVK52G.js";
9
+ } from "./chunk-WOJRQCQV.js";
10
10
 
11
11
  // src/bug-report.ts
12
12
  import { execSync, execFileSync } from "child_process";
@@ -1,3 +1,8 @@
1
+ import {
2
+ package_default,
3
+ writeRunState
4
+ } from "./chunk-GQFH2NRB.js";
5
+
1
6
  // src/memory-report.ts
2
7
  import * as fs2 from "fs";
3
8
  import * as os from "os";
@@ -9,77 +14,10 @@ import { execSync } from "child_process";
9
14
  import { createHash } from "crypto";
10
15
  import * as fs from "fs";
11
16
  import * as path from "path";
12
-
13
- // package.json
14
- var package_default = {
15
- name: "bulletin-deploy",
16
- version: "0.7.3",
17
- private: false,
18
- repository: {
19
- type: "git",
20
- url: "https://github.com/paritytech/bulletin-deploy.git"
21
- },
22
- publishConfig: {
23
- registry: "https://registry.npmjs.org",
24
- access: "public"
25
- },
26
- type: "module",
27
- main: "./dist/index.js",
28
- types: "./dist/index.d.ts",
29
- bin: {
30
- "bulletin-deploy": "./bin/bulletin-deploy"
31
- },
32
- exports: {
33
- ".": {
34
- types: "./dist/index.d.ts",
35
- import: "./dist/index.js"
36
- }
37
- },
38
- files: [
39
- "dist",
40
- "bin"
41
- ],
42
- scripts: {
43
- build: "tsup src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts --format esm --dts --clean --target node22",
44
- prepare: "npm run build",
45
- test: "npm run build && node --test test/test.js test/pool.test.js test/helpers/e2e-helpers.test.js",
46
- "test:e2e": "npm run build && node --test test/e2e.test.js",
47
- "test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
48
- "test:e2e:pr": "bash scripts/e2e-pass.sh pr",
49
- "test:e2e:nightly": "bash scripts/e2e-pass.sh nightly",
50
- benchmark: "npm run build && node benchmark.js"
51
- },
52
- dependencies: {
53
- "@ipld/car": "^5.4.3",
54
- "@ipld/dag-pb": "^4.1.3",
55
- "@noble/hashes": "^1.7.2",
56
- "@polkadot-api/substrate-bindings": "^0.16.5",
57
- "@polkadot-labs/hdkd": "^0.0.25",
58
- "@polkadot-labs/hdkd-helpers": "^0.0.26",
59
- "@polkadot/keyring": "^13.0.0",
60
- "@polkadot/util-crypto": "^13.0.0",
61
- "@sentry/node": "^9.14.0",
62
- "ipfs-unixfs": "^11.2.0",
63
- "ipfs-unixfs-importer": "^16.1.4",
64
- multiformats: "^13.4.1",
65
- "polkadot-api": "^1.23.1",
66
- viem: "^2.30.5"
67
- },
68
- devDependencies: {
69
- "@types/node": "^22.0.0",
70
- tsup: "^8.5.0",
71
- typescript: "^5.9.3"
72
- },
73
- minimumVersion: "0.5.6",
74
- engines: {
75
- node: ">=22"
76
- }
77
- };
78
-
79
- // src/telemetry.ts
80
17
  var VERSION = package_default.version;
81
18
  var DEFAULT_DSN = "https://e021c025d79c4c3ade2862a11f13c40b@o4511059872841728.ingest.de.sentry.io/4511093597405264";
82
19
  var INTERNAL_ORG_RE = /^(paritytech|w3f|polkadot-fellows)\//i;
20
+ var PARITY_HOST_APPS = /* @__PURE__ */ new Set(["playground-cli"]);
83
21
  function extractRepoSlug(url) {
84
22
  return url.replace(/.*github\.com[:/]/, "").replace(/\.git$/, "");
85
23
  }
@@ -94,13 +32,15 @@ function isInternalContextFromSignals(signals) {
94
32
  if (INTERNAL_ORG_RE.test(signals.githubRepository ?? "")) return true;
95
33
  if (signals.runnerName?.startsWith("parity-")) return true;
96
34
  if (signals.gitRemote && INTERNAL_ORG_RE.test(signals.gitRemote)) return true;
35
+ if (signals.hostApp && PARITY_HOST_APPS.has(signals.hostApp)) return true;
97
36
  return false;
98
37
  }
99
38
  function isInternalContext() {
100
39
  return isInternalContextFromSignals({
101
40
  githubRepository: process.env.GITHUB_REPOSITORY,
102
41
  runnerName: process.env.RUNNER_NAME,
103
- gitRemote: tryGitRemote()
42
+ gitRemote: tryGitRemote(),
43
+ hostApp: process.env.BULLETIN_DEPLOY_HOST_APP
104
44
  });
105
45
  }
106
46
  var OPT_OUT = process.env.BULLETIN_DEPLOY_TELEMETRY === "0";
@@ -155,8 +95,26 @@ if (!DISABLED) {
155
95
  } catch {
156
96
  }
157
97
  }
98
+ var runStateActive = false;
99
+ var relaunchOomHintShown = false;
100
+ function setRunStateActive(v) {
101
+ runStateActive = v;
102
+ }
103
+ function markRelaunchOomHintShown() {
104
+ relaunchOomHintShown = true;
105
+ }
106
+ async function closeTelemetry(timeoutMs) {
107
+ if (!Sentry) return;
108
+ try {
109
+ await Sentry.close(timeoutMs);
110
+ } catch {
111
+ }
112
+ }
158
113
  function initTelemetry() {
159
114
  if (!Sentry) return;
115
+ if (process.env.BULLETIN_DEPLOY_USE_AMBIENT_SENTRY === "1") {
116
+ return;
117
+ }
160
118
  Sentry.init({
161
119
  dsn: process.env.SENTRY_DSN || DEFAULT_DSN,
162
120
  release: `${package_default.name}@${VERSION}`,
@@ -189,6 +147,12 @@ function initTelemetry() {
189
147
  return event;
190
148
  }
191
149
  });
150
+ Sentry.setTag("bulletin-deploy.version", VERSION);
151
+ Sentry.setContext("bulletin-deploy", {
152
+ version: VERSION,
153
+ release: `${package_default.name}@${VERSION}`,
154
+ node: process.version
155
+ });
192
156
  }
193
157
  function tryPackageJsonRepo() {
194
158
  try {
@@ -220,7 +184,8 @@ function resolveRunnerType() {
220
184
  return "github-hosted";
221
185
  }
222
186
  function getDeployAttributes(domain) {
223
- return {
187
+ const hostApp = process.env.BULLETIN_DEPLOY_HOST_APP;
188
+ const attrs = {
224
189
  "deploy.repo": sanitizeRepo(resolveRepo(domain)),
225
190
  "deploy.branch": sanitizeBranch(process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || tryGitBranch()),
226
191
  "deploy.source": process.env.CI ? "ci" : "local",
@@ -230,8 +195,18 @@ function getDeployAttributes(domain) {
230
195
  "deploy.runner_type": resolveRunnerType(),
231
196
  // Seed "false" so successful spans form the %SAD denominator; the catch block and
232
197
  // captureWarning flip it to "true" on friction.
233
- "deploy.sad": "false"
198
+ "deploy.sad": "false",
199
+ // Same ratio-denominator reasoning as deploy.sad above, but for the
200
+ // %EXPECTED-refusal metric: catch block flips to "true" when the error
201
+ // matches isExpectedError (user-facing product rule, not tool friction).
202
+ "deploy.expected": "false",
203
+ // Seed "false" so every span carries the attribute (boolean-both-values rule).
204
+ // Flipped to "true" by getWsProvider's onStatusChanged when papi connects to a
205
+ // non-primary endpoint, and flushed again in deploy()'s finally block.
206
+ "deploy.rpc.failed_over": "false"
234
207
  };
208
+ if (hostApp) attrs["deploy.host_app"] = hostApp;
209
+ return attrs;
235
210
  }
236
211
  function isExpectedError(msg) {
237
212
  return /personhood|owned by|owner mismatch|reserved for original|invalid domain label|not authorized for bulletin|insufficient balance|quota exhausted|insufficient .* authorization/i.test(msg);
@@ -281,6 +256,12 @@ function sampleMemory(stage) {
281
256
  deployRootSpan.setAttribute("deploy.mem.peak_array_buffers_mb", String(toMb(memoryPeak.arrayBuffers)));
282
257
  }
283
258
  }
259
+ if (runStateActive && memoryPeak) {
260
+ try {
261
+ writeRunState({ lastPeakRssMb: toMb(memoryPeak.rss), lastStage: stage });
262
+ } catch {
263
+ }
264
+ }
284
265
  }
285
266
  async function withDeploySpan(domain, fn) {
286
267
  if (!Sentry) return fn();
@@ -293,22 +274,30 @@ async function withDeploySpan(domain, fn) {
293
274
  try {
294
275
  return await Sentry.startSpan({ op: "deploy", name: `deploy ${domain}`, attributes: attrs }, async (span) => {
295
276
  deployRootSpan = span;
296
- Sentry.setTags({
277
+ span.setAttribute("deploy.tool_version", VERSION);
278
+ if (relaunchOomHintShown) {
279
+ span.setAttribute("deploy.relaunch.oom_hint_shown", "true");
280
+ }
281
+ const tagsToSet = {
297
282
  "deploy.repo": attrs["deploy.repo"],
298
283
  "deploy.branch": attrs["deploy.branch"],
299
284
  "deploy.domain": domain,
300
285
  "deploy.source": attrs["deploy.source"],
301
286
  "deploy.tool_version": VERSION,
302
- "deploy.runner_type": resolveRunnerType()
303
- });
287
+ "deploy.runner_type": resolveRunnerType(),
288
+ "deploy.host_app": attrs["deploy.host_app"] ?? ""
289
+ };
290
+ if (!tagsToSet["deploy.host_app"]) delete tagsToSet["deploy.host_app"];
291
+ Sentry.setTags(tagsToSet);
304
292
  try {
305
293
  return await fn();
306
294
  } catch (error) {
307
295
  const msg = error.message;
308
296
  span.setAttribute("deploy.status", "error");
309
297
  span.setAttribute("deploy.error", msg.slice(0, 200));
310
- span.setAttribute("deploy.sad", "true");
311
298
  const isExpected = isExpectedError(msg);
299
+ span.setAttribute("deploy.expected", isExpected ? "true" : "false");
300
+ span.setAttribute("deploy.sad", isExpected ? "false" : "true");
312
301
  if (!isExpected) {
313
302
  span.setStatus({ code: 2, message: "internal_error" });
314
303
  }
@@ -524,6 +513,9 @@ export {
524
513
  truncateAddress,
525
514
  sanitizeBranch,
526
515
  sanitizeRepo,
516
+ setRunStateActive,
517
+ markRelaunchOomHintShown,
518
+ closeTelemetry,
527
519
  initTelemetry,
528
520
  resolveRepo,
529
521
  resolveRunner,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-BYIVK52G.js";
3
+ } from "./chunk-WOJRQCQV.js";
4
4
 
5
5
  // src/version-check.ts
6
6
  import { execSync, execFileSync } from "child_process";
package/dist/deploy.d.ts CHANGED
@@ -25,9 +25,11 @@ interface ExistingProvider {
25
25
  signer?: PolkadotSigner;
26
26
  ss58?: string;
27
27
  reconnect?: () => Promise<ProviderResult>;
28
+ fetchNonce?: (rpc: string | string[], ss58: string) => Promise<number>;
28
29
  }
29
30
  declare const DEFAULT_BULLETIN_RPC = "wss://paseo-bulletin-rpc.polkadot.io";
30
31
  declare const DEFAULT_POOL_SIZE = 10;
32
+ declare const CHUNK_MORTALITY_PERIOD = 16;
31
33
  declare function isConnectionError(error: any): boolean;
32
34
  declare function deriveRootSigner(mnemonic: string, path?: string): {
33
35
  signer: PolkadotSigner;
@@ -43,7 +45,7 @@ declare const ENCRYPT_KEY_LEN = 32;
43
45
  declare const ENCRYPT_PBKDF2_ITERATIONS = 100000;
44
46
  declare function encryptContent(data: Uint8Array, password: string): Promise<Uint8Array>;
45
47
  declare function storeFile(contentBytes: Uint8Array, { client: existingClient, unsafeApi: existingApi, signer: existingSigner }?: ExistingProvider): Promise<string>;
46
- declare function storeChunkedContent(chunks: Uint8Array[], { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect }?: ExistingProvider): Promise<string>;
48
+ declare function storeChunkedContent(chunks: Uint8Array[], { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect, fetchNonce: fetchNonceOverride }?: ExistingProvider): Promise<string>;
47
49
  declare function chunk(data: Uint8Array, size?: number): Uint8Array[];
48
50
  declare function hasIPFS(): boolean;
49
51
  declare function merkleize(directoryPath: string, outputCarPath: string): Promise<{
@@ -103,4 +105,4 @@ interface DeployOptions {
103
105
  declare function estimateUploadBytes(content: DeployContent): Promise<number | null>;
104
106
  declare function deploy(content: DeployContent, domainName?: string | null, options?: DeployOptions): Promise<DeployResult>;
105
107
 
106
- export { 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, EXIT_CODE_NO_RETRY, NonRetryableError, type StoreDirectoryOptions, chunk, computeStorageCid, createCID, deploy, deriveRootSigner, encodeContenthash, encryptContent, estimateUploadBytes, friendlyChainError, hasIPFS, isConnectionError, merkleize, storeChunkedContent, storeDirectory, storeFile };
108
+ export { 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, EXIT_CODE_NO_RETRY, NonRetryableError, type StoreDirectoryOptions, chunk, computeStorageCid, createCID, deploy, deriveRootSigner, encodeContenthash, encryptContent, estimateUploadBytes, friendlyChainError, hasIPFS, isConnectionError, merkleize, storeChunkedContent, storeDirectory, storeFile };
package/dist/deploy.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ CHUNK_MORTALITY_PERIOD,
2
3
  DEFAULT_BULLETIN_RPC,
3
4
  DEFAULT_POOL_SIZE,
4
5
  ENCRYPT_KEY_LEN,
@@ -24,16 +25,18 @@ import {
24
25
  storeChunkedContent,
25
26
  storeDirectory,
26
27
  storeFile
27
- } from "./chunk-EPNPPAMS.js";
28
- import "./chunk-4EQERQRG.js";
29
- import "./chunk-MDYSENTW.js";
30
- import "./chunk-M3H3F4FY.js";
28
+ } from "./chunk-KQ75CSJJ.js";
29
+ import "./chunk-UXKC7JAM.js";
30
+ import "./chunk-XOKNNK6E.js";
31
+ import "./chunk-SAMH7JFG.js";
31
32
  import "./chunk-2Q2WSKFD.js";
32
- import "./chunk-BYIVK52G.js";
33
+ import "./chunk-WOJRQCQV.js";
34
+ import "./chunk-GQFH2NRB.js";
33
35
  import "./chunk-B7GUYYAN.js";
34
36
  import "./chunk-JHNW2EKY.js";
35
37
  import "./chunk-QGM4M3NI.js";
36
38
  export {
39
+ CHUNK_MORTALITY_PERIOD,
37
40
  DEFAULT_BULLETIN_RPC,
38
41
  DEFAULT_POOL_SIZE,
39
42
  ENCRYPT_KEY_LEN,
package/dist/dotns.d.ts CHANGED
@@ -67,7 +67,13 @@ declare const WS_HEARTBEAT_TIMEOUT_MS: number;
67
67
  declare const DOTNS_TX_MAX_ATTEMPTS: number;
68
68
  declare function classifyTxRetryDecision(err: unknown): "retry" | "abort";
69
69
  declare const DEFAULT_MNEMONIC: string;
70
- declare function fetchNonce(rpc: string, ss58Address: string): Promise<number>;
70
+ declare function fetchNonce(rpc: string | string[], ss58Address: string): Promise<number>;
71
+ declare function verifyNonceAdvanced(endpoints: string[], ss58Address: string, originalNonce: number): Promise<{
72
+ advanced: true;
73
+ witnessRpc: string;
74
+ } | {
75
+ advanced: false;
76
+ }>;
71
77
  declare const ProofOfPersonhoodStatus: {
72
78
  readonly NoStatus: 0;
73
79
  readonly ProofOfPersonhoodLite: 1;
@@ -82,6 +88,7 @@ declare function stripTrailingDigits(label: string): string;
82
88
  declare function sanitizeDomainLabel(label: string): string;
83
89
  declare function validateDomainLabel(label: string): string;
84
90
  declare function isCommitmentMature(chainNowSeconds: number, commitTimestampSeconds: number, minimumAgeSeconds: number): boolean;
91
+ declare function isExplicitCommitmentBuffer(envValue: string | undefined): boolean;
85
92
  declare function classifyDotnsLabel(label: string): {
86
93
  status: number;
87
94
  message: string;
@@ -105,28 +112,9 @@ declare class ReviveClientWrapper {
105
112
  constructor(client: any);
106
113
  getEvmAddress(substrateAddress: string): Promise<string>;
107
114
  performDryRunCall(originSubstrateAddress: string, contractAddress: string, value: bigint, encodedData: string): Promise<any>;
108
- estimateGasForCall(originSubstrateAddress: string, contractAddress: string, value: bigint, encodedData: string): Promise<any>;
109
115
  checkIfAccountMapped(substrateAddress: string): Promise<boolean>;
110
- ensureAccountMapped(substrateAddress: string, signer: PolkadotSigner): Promise<void>;
111
- signAndSubmitExtrinsic(extrinsic: any, signer: PolkadotSigner, statusCallback: (status: string) => void, _opts?: {
112
- nonceFallback?: {
113
- rpc: string;
114
- senderSS58: string;
115
- expectedNonce: number;
116
- };
117
- }): Promise<string>;
118
- signAndSubmitWithRetry(buildExtrinsic: () => any, signer: PolkadotSigner, statusCallback: (status: string) => void, label: string, opts?: {
119
- nonceFallback?: {
120
- rpc: string;
121
- senderSS58: string;
122
- expectedNonce: number;
123
- };
124
- }): Promise<string>;
125
- submitTransaction(contractAddress: string, value: bigint, encodedData: string, signerSubstrateAddress: string, signer: PolkadotSigner, statusCallback: (status: string) => void, { rpc, useNoncePolling }?: {
126
- rpc?: string;
127
- useNoncePolling?: boolean;
128
- }): Promise<string>;
129
116
  }
117
+ declare function runDotnsCli(argv: string[], env?: Record<string, string>): Promise<unknown>;
130
118
  declare class DotNS {
131
119
  client: any | null;
132
120
  clientWrapper: ReviveClientWrapper | null;
@@ -135,33 +123,17 @@ declare class DotNS {
135
123
  evmAddress: string | null;
136
124
  signer: PolkadotSigner | null;
137
125
  connected: boolean;
126
+ private _mnemonic;
127
+ private _keyUri;
138
128
  constructor();
139
129
  connect(options?: DotNSConnectOptions): Promise<this>;
140
130
  ensureConnected(): void;
141
131
  private _testnetCache;
142
132
  isTestnet(): Promise<boolean>;
143
133
  contractCall(contractAddress: string, contractAbi: readonly any[], functionName: string, args?: any[]): Promise<any>;
144
- contractTransaction(contractAddress: string, value: bigint, contractAbi: readonly any[], functionName: string, args?: any[], statusCallback?: (status: string) => void, { useNoncePolling }?: {
145
- useNoncePolling?: boolean;
146
- }): Promise<string>;
147
134
  checkOwnership(label: string, ownerAddress?: string | null): Promise<OwnershipResult>;
148
- classifyName(label: string): Promise<{
149
- requiredStatus: number;
150
- message: string;
151
- }>;
152
135
  getUserPopStatus(ownerAddress?: string | null): Promise<number>;
153
136
  setUserPopStatus(status: number): Promise<void>;
154
- ensureNotRegistered(label: string): Promise<void>;
155
- generateCommitment(label: string, includeReverse?: boolean): Promise<{
156
- commitment: any;
157
- registration: any;
158
- }>;
159
- submitCommitment(commitment: any): Promise<void>;
160
- waitForCommitmentAge(commitment: any): Promise<void>;
161
- getPriceAndValidate(label: string): Promise<PriceValidationResult>;
162
- finalizeRegistration(registration: any, priceWei: bigint): Promise<void>;
163
- verifyOwnership(label: string): Promise<void>;
164
- getContenthash(domainName: string): Promise<string>;
165
137
  checkSubdomainOwnership(sublabel: string, parentLabel: string): Promise<OwnershipResult>;
166
138
  registerSubdomain(sublabel: string, parentLabel: string): Promise<{
167
139
  sublabel: string;
@@ -171,6 +143,7 @@ declare class DotNS {
171
143
  setContenthash(domainName: string, contenthashHex: string): Promise<{
172
144
  node: string;
173
145
  }>;
146
+ getContenthash(domainName: string): Promise<string>;
174
147
  preflight(label: string, explicitStatusOverride?: string): Promise<DotnsPreflightResult>;
175
148
  register(label: string, options?: DotNSConnectOptions & {
176
149
  status?: string;
@@ -183,4 +156,4 @@ declare class DotNS {
183
156
  }
184
157
  declare const dotns: DotNS;
185
158
 
186
- export { CONNECTION_TIMEOUT_MS, CONTRACTS, DECIMALS, DEFAULT_MNEMONIC, DOTNS_TX_MAX_ATTEMPTS, DOT_NODE, DotNS, type DotNSConnectOptions, type DotnsPreflightResult, NATIVE_TO_ETH_RATIO, OPERATION_TIMEOUT_MS, type OwnershipResult, type ParsedDomainName, type PriceValidationResult, ProofOfPersonhoodStatus, RPC_ENDPOINTS, TX_CHAIN_TIME_BUDGET_MS, TX_TIMEOUT_MS, TX_WALL_CLOCK_CEILING_MS, WS_HEARTBEAT_TIMEOUT_MS, canRegister, classifyDotnsLabel, classifyTxRetryDecision, computeDomainTokenId, convertWeiToNative, countTrailingDigits, dotns, fetchNonce, isCommitmentMature, parseDomainName, parseProofOfPersonhoodStatus, popStatusName, sanitizeDomainLabel, simulateUserStatus, stripTrailingDigits, validateDomainLabel };
159
+ export { CONNECTION_TIMEOUT_MS, CONTRACTS, DECIMALS, DEFAULT_MNEMONIC, DOTNS_TX_MAX_ATTEMPTS, DOT_NODE, DotNS, type DotNSConnectOptions, type DotnsPreflightResult, NATIVE_TO_ETH_RATIO, OPERATION_TIMEOUT_MS, type OwnershipResult, type ParsedDomainName, type PriceValidationResult, ProofOfPersonhoodStatus, RPC_ENDPOINTS, TX_CHAIN_TIME_BUDGET_MS, TX_TIMEOUT_MS, TX_WALL_CLOCK_CEILING_MS, WS_HEARTBEAT_TIMEOUT_MS, canRegister, classifyDotnsLabel, classifyTxRetryDecision, computeDomainTokenId, convertWeiToNative, countTrailingDigits, dotns, fetchNonce, isCommitmentMature, isExplicitCommitmentBuffer, parseDomainName, parseProofOfPersonhoodStatus, popStatusName, runDotnsCli, sanitizeDomainLabel, simulateUserStatus, stripTrailingDigits, validateDomainLabel, verifyNonceAdvanced };
package/dist/dotns.js CHANGED
@@ -23,15 +23,19 @@ import {
23
23
  dotns,
24
24
  fetchNonce,
25
25
  isCommitmentMature,
26
+ isExplicitCommitmentBuffer,
26
27
  parseDomainName,
27
28
  parseProofOfPersonhoodStatus,
28
29
  popStatusName,
30
+ runDotnsCli,
29
31
  sanitizeDomainLabel,
30
32
  simulateUserStatus,
31
33
  stripTrailingDigits,
32
- validateDomainLabel
33
- } from "./chunk-M3H3F4FY.js";
34
- import "./chunk-BYIVK52G.js";
34
+ validateDomainLabel,
35
+ verifyNonceAdvanced
36
+ } from "./chunk-SAMH7JFG.js";
37
+ import "./chunk-WOJRQCQV.js";
38
+ import "./chunk-GQFH2NRB.js";
35
39
  import "./chunk-JHNW2EKY.js";
36
40
  import "./chunk-QGM4M3NI.js";
37
41
  export {
@@ -59,11 +63,14 @@ export {
59
63
  dotns,
60
64
  fetchNonce,
61
65
  isCommitmentMature,
66
+ isExplicitCommitmentBuffer,
62
67
  parseDomainName,
63
68
  parseProofOfPersonhoodStatus,
64
69
  popStatusName,
70
+ runDotnsCli,
65
71
  sanitizeDomainLabel,
66
72
  simulateUserStatus,
67
73
  stripTrailingDigits,
68
- validateDomainLabel
74
+ validateDomainLabel,
75
+ verifyNonceAdvanced
69
76
  };
package/dist/index.d.ts CHANGED
@@ -2,5 +2,6 @@ export { DeployContent, DeployOptions, DeployResult, deploy } from './deploy.js'
2
2
  export { PoolAccount, PoolAuthorization, bootstrapPool, derivePoolAccounts, ensureAuthorized, fetchPoolAuthorizations, selectAccount } from './pool.js';
3
3
  export { DotNS, DotNSConnectOptions, OwnershipResult, ParsedDomainName, PriceValidationResult, parseDomainName } from './dotns.js';
4
4
  export { MerkleizeResult, merkleizeJS } from './merkle.js';
5
+ export { RunState, RunStatus, VERSION, loadRunState, probablyOomRssMb, resolveStateDir, shouldShowOomHint, shouldSkipStaleWarning, stateFilePath, writeRunState } from './run-state.js';
5
6
  import 'multiformats/cid';
6
7
  import 'polkadot-api';
package/dist/index.js CHANGED
@@ -1,14 +1,24 @@
1
1
  import {
2
2
  deploy
3
- } from "./chunk-EPNPPAMS.js";
4
- import "./chunk-4EQERQRG.js";
5
- import "./chunk-MDYSENTW.js";
3
+ } from "./chunk-KQ75CSJJ.js";
4
+ import "./chunk-UXKC7JAM.js";
5
+ import "./chunk-XOKNNK6E.js";
6
6
  import {
7
7
  DotNS,
8
8
  parseDomainName
9
- } from "./chunk-M3H3F4FY.js";
9
+ } from "./chunk-SAMH7JFG.js";
10
10
  import "./chunk-2Q2WSKFD.js";
11
- import "./chunk-BYIVK52G.js";
11
+ import "./chunk-WOJRQCQV.js";
12
+ import {
13
+ VERSION,
14
+ loadRunState,
15
+ probablyOomRssMb,
16
+ resolveStateDir,
17
+ shouldShowOomHint,
18
+ shouldSkipStaleWarning,
19
+ stateFilePath,
20
+ writeRunState
21
+ } from "./chunk-GQFH2NRB.js";
12
22
  import {
13
23
  merkleizeJS
14
24
  } from "./chunk-B7GUYYAN.js";
@@ -22,12 +32,20 @@ import {
22
32
  import "./chunk-QGM4M3NI.js";
23
33
  export {
24
34
  DotNS,
35
+ VERSION,
25
36
  bootstrapPool,
26
37
  deploy,
27
38
  derivePoolAccounts,
28
39
  ensureAuthorized,
29
40
  fetchPoolAuthorizations,
41
+ loadRunState,
30
42
  merkleizeJS,
31
43
  parseDomainName,
32
- selectAccount
44
+ probablyOomRssMb,
45
+ resolveStateDir,
46
+ selectAccount,
47
+ shouldShowOomHint,
48
+ shouldSkipStaleWarning,
49
+ stateFilePath,
50
+ writeRunState
33
51
  };
@@ -5,7 +5,8 @@ import {
5
5
  maybeWriteMemoryReport,
6
6
  safeHeap,
7
7
  sampleFromBytes
8
- } from "./chunk-BYIVK52G.js";
8
+ } from "./chunk-WOJRQCQV.js";
9
+ import "./chunk-GQFH2NRB.js";
9
10
  import "./chunk-QGM4M3NI.js";
10
11
  export {
11
12
  DEFAULT_THRESHOLD_MB,
@@ -0,0 +1,22 @@
1
+ declare const VERSION: string;
2
+ type RunStatus = "running" | "succeeded" | "failed" | "crashed";
3
+ interface RunState {
4
+ status: RunStatus;
5
+ pid: number;
6
+ startedAt: number;
7
+ endedAt?: number;
8
+ toolVersion: string;
9
+ argv: string[];
10
+ lastPeakRssMb: number | null;
11
+ lastStage: string | null;
12
+ reason?: string;
13
+ }
14
+ declare function resolveStateDir(): string;
15
+ declare function stateFilePath(): string;
16
+ declare function loadRunState(): RunState | null;
17
+ declare function writeRunState(patch: Partial<RunState>): void;
18
+ declare function shouldSkipStaleWarning(prev: RunState): boolean;
19
+ declare function probablyOomRssMb(override?: number): number;
20
+ declare function shouldShowOomHint(prev: RunState): boolean;
21
+
22
+ export { type RunState, type RunStatus, VERSION, loadRunState, probablyOomRssMb, resolveStateDir, shouldShowOomHint, shouldSkipStaleWarning, stateFilePath, writeRunState };
@@ -0,0 +1,21 @@
1
+ import {
2
+ VERSION,
3
+ loadRunState,
4
+ probablyOomRssMb,
5
+ resolveStateDir,
6
+ shouldShowOomHint,
7
+ shouldSkipStaleWarning,
8
+ stateFilePath,
9
+ writeRunState
10
+ } from "./chunk-GQFH2NRB.js";
11
+ import "./chunk-QGM4M3NI.js";
12
+ export {
13
+ VERSION,
14
+ loadRunState,
15
+ probablyOomRssMb,
16
+ resolveStateDir,
17
+ shouldShowOomHint,
18
+ shouldSkipStaleWarning,
19
+ stateFilePath,
20
+ writeRunState
21
+ };
@@ -6,6 +6,7 @@ interface InternalContextSignals {
6
6
  githubRepository?: string;
7
7
  runnerName?: string;
8
8
  gitRemote?: string;
9
+ hostApp?: string;
9
10
  }
10
11
  declare function isInternalContextFromSignals(signals: InternalContextSignals): boolean;
11
12
  declare function isInternalContext(): boolean;
@@ -13,6 +14,9 @@ declare function scrubPaths(msg: string): string;
13
14
  declare function truncateAddress(ss58: string | undefined): string | undefined;
14
15
  declare function sanitizeBranch(name: string | undefined): string | undefined;
15
16
  declare function sanitizeRepo(slug: string | undefined): string | undefined;
17
+ declare function setRunStateActive(v: boolean): void;
18
+ declare function markRelaunchOomHintShown(): void;
19
+ declare function closeTelemetry(timeoutMs: number): Promise<void>;
16
20
  declare function initTelemetry(): void;
17
21
  declare function resolveRepo(domain: string): string;
18
22
  declare function resolveRunner(): string;
@@ -31,4 +35,4 @@ declare function setDeploySentryTag(key: string, value: string): void;
31
35
  declare function captureWarning(message: string, context?: Record<string, unknown>): void;
32
36
  declare function flush(): Promise<void>;
33
37
 
34
- export { type InternalContextSignals, VERSION, captureWarning, flush, getCurrentSentryTraceId, getDeployAttributes, initTelemetry, isExpectedError, isInternalContext, isInternalContextFromSignals, resolveRepo, resolveRunner, resolveRunnerType, sampleMemory, sanitizeBranch, sanitizeRepo, scrubPaths, setDeployAttribute, setDeployReportContext, setDeploySentryTag, truncateAddress, withDeploySpan, withSpan };
38
+ export { type InternalContextSignals, VERSION, captureWarning, closeTelemetry, flush, getCurrentSentryTraceId, getDeployAttributes, initTelemetry, isExpectedError, isInternalContext, isInternalContextFromSignals, markRelaunchOomHintShown, resolveRepo, resolveRunner, resolveRunnerType, sampleMemory, sanitizeBranch, sanitizeRepo, scrubPaths, setDeployAttribute, setDeployReportContext, setDeploySentryTag, setRunStateActive, truncateAddress, withDeploySpan, withSpan };
package/dist/telemetry.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  VERSION,
3
3
  captureWarning,
4
+ closeTelemetry,
4
5
  flush,
5
6
  getCurrentSentryTraceId,
6
7
  getDeployAttributes,
@@ -8,6 +9,7 @@ import {
8
9
  isExpectedError,
9
10
  isInternalContext,
10
11
  isInternalContextFromSignals,
12
+ markRelaunchOomHintShown,
11
13
  resolveRepo,
12
14
  resolveRunner,
13
15
  resolveRunnerType,
@@ -18,14 +20,17 @@ import {
18
20
  setDeployAttribute,
19
21
  setDeployReportContext,
20
22
  setDeploySentryTag,
23
+ setRunStateActive,
21
24
  truncateAddress,
22
25
  withDeploySpan,
23
26
  withSpan
24
- } from "./chunk-BYIVK52G.js";
27
+ } from "./chunk-WOJRQCQV.js";
28
+ import "./chunk-GQFH2NRB.js";
25
29
  import "./chunk-QGM4M3NI.js";
26
30
  export {
27
31
  VERSION,
28
32
  captureWarning,
33
+ closeTelemetry,
29
34
  flush,
30
35
  getCurrentSentryTraceId,
31
36
  getDeployAttributes,
@@ -33,6 +38,7 @@ export {
33
38
  isExpectedError,
34
39
  isInternalContext,
35
40
  isInternalContextFromSignals,
41
+ markRelaunchOomHintShown,
36
42
  resolveRepo,
37
43
  resolveRunner,
38
44
  resolveRunnerType,
@@ -43,6 +49,7 @@ export {
43
49
  setDeployAttribute,
44
50
  setDeployReportContext,
45
51
  setDeploySentryTag,
52
+ setRunStateActive,
46
53
  truncateAddress,
47
54
  withDeploySpan,
48
55
  withSpan
@@ -8,8 +8,9 @@ import {
8
8
  isPreReleaseVersion,
9
9
  preReleaseWarning,
10
10
  promptYesNo
11
- } from "./chunk-MDYSENTW.js";
12
- import "./chunk-BYIVK52G.js";
11
+ } from "./chunk-XOKNNK6E.js";
12
+ import "./chunk-WOJRQCQV.js";
13
+ import "./chunk-GQFH2NRB.js";
13
14
  import "./chunk-QGM4M3NI.js";
14
15
  export {
15
16
  assessVersion,