bulletin-deploy 0.19.4 → 0.20.0-rc.2

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 (96) hide show
  1. package/bin/bulletin-deploy +65 -13
  2. package/dist/auth/index.d.ts +5 -4
  3. package/dist/auth/index.js +17 -8
  4. package/dist/{allocations-CEPeZr6T.d.ts → auth/vendor/allocations.d.ts} +1 -1
  5. package/dist/auth/vendor/allocations.js +14 -0
  6. package/dist/{auth-CA_YKtM2.d.ts → auth/vendor/auth.d.ts} +3 -26
  7. package/dist/auth/vendor/auth.js +10 -0
  8. package/dist/auth/vendor/index.d.ts +7 -31
  9. package/dist/auth/vendor/index.js +16 -9
  10. package/dist/auth/vendor/sessionSigner.d.ts +28 -0
  11. package/dist/auth/vendor/sessionSigner.js +14 -0
  12. package/dist/{signer-Duup0hgQ.d.ts → auth/vendor/signer.d.ts} +5 -2
  13. package/dist/auth/vendor/signer.js +10 -0
  14. package/dist/auth/vendor/types.d.ts +25 -0
  15. package/dist/auth/vendor/types.js +0 -0
  16. package/dist/auth/vendor/ui/index.d.ts +4 -13
  17. package/dist/auth/vendor/ui/index.js +6 -3
  18. package/dist/auth/vendor/ui/qr.d.ts +1 -0
  19. package/dist/auth/vendor/ui/qr.js +6 -0
  20. package/dist/auth/vendor/ui/status.d.ts +16 -0
  21. package/dist/auth/vendor/ui/status.js +8 -0
  22. package/dist/auth-config.d.ts +12 -3
  23. package/dist/auth-config.js +6 -4
  24. package/dist/bug-report.js +4 -4
  25. package/dist/chain-health.js +3 -3
  26. package/dist/chunk-2C6SLLBI.js +57 -0
  27. package/dist/{chunk-2P4EZOFF.js → chunk-3PJ36POL.js} +1 -1
  28. package/dist/{chunk-FWJQAIVO.js → chunk-3QJZWZ2N.js} +61 -19
  29. package/dist/chunk-7SXO544V.js +40 -0
  30. package/dist/{chunk-D3YME2EG.js → chunk-CI4MX3LD.js} +8 -4
  31. package/dist/{chunk-OONQPYHM.js → chunk-DDSBHHGU.js} +111 -25
  32. package/dist/chunk-DFKEG3WY.js +0 -0
  33. package/dist/chunk-EHAL4CJM.js +120 -0
  34. package/dist/{chunk-H44NO63C.js → chunk-G7EH3XIW.js} +8 -185
  35. package/dist/chunk-HEMKSKGG.js +59 -0
  36. package/dist/{chunk-ZZIOS4RG.js → chunk-IAS32V73.js} +449 -135
  37. package/dist/{chunk-F24S4EV5.js → chunk-IJIU2WZU.js} +3 -2
  38. package/dist/{chunk-JTH3ISLR.js → chunk-K3W5WDNY.js} +8 -8
  39. package/dist/{chunk-R3BXRRKE.js → chunk-KHASCR2I.js} +1 -1
  40. package/dist/{chunk-BFK5UCUJ.js → chunk-KJGXS3AY.js} +30 -3
  41. package/dist/{chunk-6J4WRFRL.js → chunk-N2NOZWSH.js} +1 -1
  42. package/dist/chunk-NJKXXDDK.js +0 -0
  43. package/dist/{chunk-U2QO5G35.js → chunk-PH65V5GG.js} +6 -4
  44. package/dist/chunk-RHCXBXBW.js +17 -0
  45. package/dist/chunk-RPBMNTGZ.js +6 -0
  46. package/dist/chunk-S6CPT2TU.js +94 -0
  47. package/dist/{chunk-C437RTTU.js → chunk-TBTAJZUS.js} +48 -142
  48. package/dist/{chunk-UFP2XWZ4.js → chunk-UEAWWSKI.js} +3 -3
  49. package/dist/{chunk-D6BE3RAU.js → chunk-V6IS3YFE.js} +177 -77
  50. package/dist/{chunk-RIRDBSBG.js → chunk-YP3LINCF.js} +0 -4
  51. package/dist/{chunk-CCIBF55X.js → chunk-ZN7PPHMX.js} +1 -1
  52. package/dist/chunk-probe.js +3 -3
  53. package/dist/cli-name.d.ts +3 -0
  54. package/dist/cli-name.js +6 -0
  55. package/dist/code-paths.d.ts +24 -0
  56. package/dist/code-paths.js +6 -0
  57. package/dist/commands/login.d.ts +1 -1
  58. package/dist/commands/login.js +28 -20
  59. package/dist/commands/logout.d.ts +3 -2
  60. package/dist/commands/logout.js +13 -7
  61. package/dist/commands/transfer.js +11 -9
  62. package/dist/commands/whoami.d.ts +3 -2
  63. package/dist/commands/whoami.js +6 -6
  64. package/dist/deploy-actors.d.ts +4 -3
  65. package/dist/deploy-actors.js +19 -11
  66. package/dist/deploy.d.ts +75 -3
  67. package/dist/deploy.js +44 -20
  68. package/dist/dotns.d.ts +111 -47
  69. package/dist/dotns.js +12 -6
  70. package/dist/incremental-stats.js +1 -1
  71. package/dist/index.d.ts +5 -50
  72. package/dist/index.js +54 -32
  73. package/dist/manifest/product-preflight.d.ts +46 -0
  74. package/dist/manifest/product-preflight.js +17 -0
  75. package/dist/manifest/publish.d.ts +31 -1
  76. package/dist/manifest/publish.js +32 -21
  77. package/dist/manifest-fetch.d.ts +10 -0
  78. package/dist/manifest-fetch.js +1 -1
  79. package/dist/manifest-roundtrip.js +1 -1
  80. package/dist/memory-report.js +2 -2
  81. package/dist/merkle.js +26 -18
  82. package/dist/personhood/bootstrap.js +19 -16
  83. package/dist/personhood/people-client.js +10 -7
  84. package/dist/pool.d.ts +18 -2
  85. package/dist/pool.js +12 -1
  86. package/dist/run-state.d.ts +19 -1
  87. package/dist/run-state.js +11 -1
  88. package/dist/sss-allowance-cache.js +5 -5
  89. package/dist/storage-signer.js +26 -18
  90. package/dist/telemetry.d.ts +1 -23
  91. package/dist/telemetry.js +2 -2
  92. package/dist/version-check.js +3 -3
  93. package/dist/ws.d.ts +12 -0
  94. package/dist/ws.js +16 -0
  95. package/package.json +3 -3
  96. /package/dist/{chunk-TSPERKUS.js → chunk-DNXE3Q5D.js} +0 -0
@@ -6,15 +6,20 @@
6
6
  // SDK modules that trigger the "@parity/product-sdk-logger" localStorage warning.
7
7
  import "../dist/suppress-localstorage-warning.js";
8
8
 
9
- import { deploy, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, NonRetryableError, EXIT_CODE_NO_RETRY, isConnectionError, isBenignTeardownError, resolveEffectiveMnemonic, mnemonicConflictNotice, resolveEnvId, shouldPublishManifest, nonInteractivePhoneConfirmationError } from "../dist/deploy.js";
9
+ import { deploy, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, NonRetryableError, EXIT_CODE_NO_RETRY, isConnectionError, isBenignTeardownError, resolveEffectiveMnemonic, mnemonicConflictNotice, resolveEnvId, shouldPublishManifest, nonInteractivePhoneConfirmationError, printDeploymentCompleteBanner } from "../dist/deploy.js";
10
10
  import { VERSION, setDeployAttribute, captureWarning, closeTelemetry, setRunStateActive, markRelaunchOomHintShown, setVersionFreshness } from "../dist/telemetry.js";
11
11
  import { handleFailedDeploy, handlePreflightVersionCheck, fetchVersionInfo, preReleaseWarning, checkNodeVersion, classifyVersionFreshness, isInteractive } from "../dist/version-check.js";
12
12
  import { setDeployContext, installLogCapture, buildCliFlagsSummary } from "../dist/bug-report.js";
13
13
  import { loadRunState, writeRunState, shouldSkipStaleWarning, shouldShowOomHint, probablyOomRssMb } from "../dist/run-state.js";
14
- import { loadEnvironments, listEnvironments, formatEnvironmentTable, DEFAULT_ENV_ID } from "../dist/environments.js";
14
+ import { loadEnvironments, listEnvironments, formatEnvironmentTable, resolveEndpoints, DEFAULT_ENV_ID } from "../dist/environments.js";
15
+ import { DEFAULT_TLD } from "../dist/dotns.js";
16
+ import { GuardedWebSocket } from "../dist/ws.js";
15
17
  import * as fs from "fs";
16
18
  import * as readline from "readline";
17
19
 
20
+ // The SSO SDKs build their own papi providers from the global WebSocket.
21
+ globalThis.WebSocket = GuardedWebSocket;
22
+
18
23
  // Install early so anything printed during flag parsing / preflight is
19
24
  // available to the bug-report log tail.
20
25
  installLogCapture();
@@ -454,25 +459,68 @@ try {
454
459
  // #1163: --no-manifest (--content-only) skips this entirely — the deploy is
455
460
  // content-only regardless of any discoverable config, so there's nothing to
456
461
  // preflight.
462
+ //
463
+ // #1164: hoisted so the SAME loaded config (one filesystem walk-up + parse)
464
+ // can drive both the manifestPending banner decision below and the actual
465
+ // publishManifest() call further down — previously each of those three call
466
+ // sites (this preflight, the banner decision, the publish block) reloaded
467
+ // the config independently. resolveConfigPath resolves `cwd` via
468
+ // `path.resolve(options.cwd ?? process.cwd())` (src/manifest/config-load.ts),
469
+ // which is idempotent, so reusing this result (loaded with the raw
470
+ // `buildDir`) is identical to the publish block's old `buildDirAbs`-based
471
+ // reload.
472
+ let preflightedConfig = null;
457
473
  if (!flags.noManifest) {
458
474
  try {
459
- const { preflightProductConfig } = await import("../dist/index.js");
475
+ const { preflightProductConfig, reconcileManifestDomain } = await import("../dist/index.js");
460
476
  // config-load resolves a relative cwd internally, so no node:path here
461
477
  // (it's only dynamically imported later, in the publish block).
462
- await preflightProductConfig(
463
- flags.config ? { path: flags.config } : { cwd: buildDir, walkUp: true },
464
- );
478
+ // #1156: preflightProductConfig (config discovery/parse + icon/executable
479
+ // file checks) and loadEnvironments (a local environments.json read)
480
+ // have no data dependency on each other — run them concurrently rather
481
+ // than paying their I/O sequentially.
482
+ const [loadedConfig, { doc }] = await Promise.all([
483
+ preflightProductConfig(
484
+ flags.config ? { path: flags.config } : { cwd: buildDir, walkUp: true },
485
+ ),
486
+ // No options: flags.environmentFile was already copied into
487
+ // process.env.BULLETIN_DEPLOY_ENV_FILE above, which loadEnvironments
488
+ // reads as its own default — passing it again here would just be
489
+ // recomputing that same fallback.
490
+ loadEnvironments(),
491
+ ]);
492
+ preflightedConfig = loadedConfig;
493
+ // Reconcile the config's domain against the ACTUAL deploy target
494
+ // BEFORE deploy() runs at all — this is the real "nothing uploaded
495
+ // yet" gate; src/manifest/publish.ts's own call to the same helper
496
+ // (inside publishManifest) is only a backstop for a library caller
497
+ // that skips this CLI entirely. Same env/TLD resolution publishManifest
498
+ // itself uses (loadEnvironments + resolveEndpoints), so this sees the
499
+ // identical environment the deploy will target — no RPC call, both are
500
+ // local config reads.
501
+ if (loadedConfig) {
502
+ const resolved = resolveEndpoints(doc, effectiveEnvId ?? DEFAULT_ENV_ID);
503
+ const envTld = resolved.tld ?? DEFAULT_TLD;
504
+ reconcileManifestDomain(loadedConfig.config.domain, domain, envTld, loadedConfig.sourcePath);
505
+ }
465
506
  } catch (err) {
466
507
  console.error(`Error: ${err?.message ?? err}`);
467
508
  process.exit(err instanceof NonRetryableError ? EXIT_CODE_NO_RETRY : 1);
468
509
  }
469
510
  }
470
511
 
512
+ // #1164: determine up front whether a manifest publish will follow, so
513
+ // deploy() can defer the "DEPLOYMENT COMPLETE" banner until publishManifest
514
+ // actually succeeds. Reuses the SAME preflightedConfig loaded just above —
515
+ // no second config load.
516
+ const manifestWillPublish = shouldPublishManifest({ configFound: !!preflightedConfig, noManifest: !!flags.noManifest });
517
+
471
518
  const result = await deploy(buildDir, domain, {
472
519
  mnemonic: effectiveMnemonic,
473
520
  derivationPath: flags.derivationPath,
474
521
  productName: flags.productName,
475
522
  suri: flags.suri,
523
+ manifestPending: manifestWillPublish,
476
524
  rpc: flags.rpc,
477
525
  env: effectiveEnvId,
478
526
  poolSize: flags.poolSize,
@@ -569,16 +617,15 @@ try {
569
617
  //
570
618
  // #1163: --no-manifest (--content-only) skips manifest publishing even when
571
619
  // a config is present. shouldPublishManifest() is the single source of
572
- // truth for that decision (config discovery still runs either way, so the
573
- // "config found but --no-manifest set" case is exercised for real, not just
574
- // in unit tests).
620
+ // truth for that decision.
621
+ //
622
+ // #1164: reuses `preflightedConfig` (loaded once, above) instead of a third
623
+ // independent tryLoadProductConfig call.
575
624
  {
576
- const { tryLoadProductConfig, publishManifest } = await import("../dist/index.js");
625
+ const { publishManifest } = await import("../dist/index.js");
577
626
  const path = await import("node:path");
578
627
  const buildDirAbs = path.resolve(buildDir);
579
- const loaded = await tryLoadProductConfig(
580
- flags.config ? { path: flags.config } : { cwd: buildDirAbs, walkUp: true },
581
- );
628
+ const loaded = preflightedConfig;
582
629
  if (shouldPublishManifest({ configFound: !!loaded, noManifest: !!flags.noManifest })) {
583
630
  try {
584
631
  await publishManifest({
@@ -596,6 +643,11 @@ try {
596
643
  storageSigner: result.storageSigner,
597
644
  storageSignerAddress: result.storageSignerAddress,
598
645
  });
646
+ // #1164: deploy() deferred the real completion banner (manifestPending
647
+ // was set above) — print it now that the manifest phase actually
648
+ // succeeded, so a manifest publish failure never leaves a false
649
+ // "DEPLOYMENT COMPLETE!" on screen.
650
+ printDeploymentCompleteBanner(result.fullDomain, result.browserUrl);
599
651
  } catch (err) {
600
652
  console.error(`Manifest publish failed: ${err?.message ?? err}`);
601
653
  process.exit(err instanceof NonRetryableError ? EXIT_CODE_NO_RETRY : 1);
@@ -1,7 +1,8 @@
1
- export { A as AuthClient, a as AuthConfig, C as ConnectResult, L as LoginHandle, b as LoginStatus, c as LogoutHandle, d as LogoutStatus, S as SessionAddresses, e as SessionHandle, f as createAuthClient } from '../auth-CA_YKtM2.js';
1
+ export { AuthClient, ConnectResult, LoginHandle, LoginStatus, LogoutHandle, LogoutStatus, SessionAddresses, SessionHandle, createAuthClient } from './vendor/auth.js';
2
2
  export { renderQrCode } from '@parity/product-sdk-terminal';
3
- export { R as ResolvedSigner, S as SignerNotAvailableError, r as resolveSigner } from '../signer-Duup0hgQ.js';
4
- export { A as AllocatableResource, a as AllocationOutcome, b as AllocationSummary, B as BULLETIN_RESOURCE, D as DEFAULT_RESOURCES, c as createSlotAccountSigner, r as requestResourceAllocation, s as summarizeOutcomes } from '../allocations-CEPeZr6T.js';
5
- export { renderLoginStatus, renderLogoutStatus } from './vendor/ui/index.js';
3
+ export { ResolvedSigner, SignerNotAvailableError, resolveSigner } from './vendor/signer.js';
4
+ export { AllocatableResource, AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './vendor/allocations.js';
5
+ export { AuthConfig } from './vendor/types.js';
6
+ export { renderLoginStatus, renderLogoutStatus } from './vendor/ui/status.js';
6
7
  import 'polkadot-api';
7
8
  import '@parity/product-sdk-tx';
@@ -1,21 +1,30 @@
1
1
  import "../chunk-JQKKMUCT.js";
2
+ import "../chunk-DFKEG3WY.js";
2
3
  import {
3
- renderLoginStatus,
4
- renderLogoutStatus,
5
4
  renderQrCode
6
- } from "../chunk-RIRDBSBG.js";
5
+ } from "../chunk-RPBMNTGZ.js";
6
+ import {
7
+ renderLoginStatus,
8
+ renderLogoutStatus
9
+ } from "../chunk-YP3LINCF.js";
10
+ import "../chunk-NJKXXDDK.js";
11
+ import {
12
+ createAuthClient
13
+ } from "../chunk-G7EH3XIW.js";
7
14
  import {
8
15
  BULLETIN_RESOURCE,
9
16
  DEFAULT_RESOURCES,
10
- SignerNotAvailableError,
11
- createAuthClient,
12
17
  createSlotAccountSigner,
13
18
  requestResourceAllocation,
14
- resolveSigner,
15
19
  summarizeOutcomes
16
- } from "../chunk-H44NO63C.js";
17
- import "../chunk-TSPERKUS.js";
20
+ } from "../chunk-7SXO544V.js";
21
+ import "../chunk-S6CPT2TU.js";
22
+ import {
23
+ SignerNotAvailableError,
24
+ resolveSigner
25
+ } from "../chunk-2C6SLLBI.js";
18
26
  import "../chunk-SH2LG52Z.js";
27
+ import "../chunk-DNXE3Q5D.js";
19
28
  export {
20
29
  BULLETIN_RESOURCE,
21
30
  DEFAULT_RESOURCES,
@@ -108,4 +108,4 @@ declare function summarizeOutcomes(outcomes: AllocationOutcome[], resources: All
108
108
  */
109
109
  declare function createSlotAccountSigner(adapter: TerminalAdapter, resource: AllocatableResource): Promise<polkadot_api.PolkadotSigner | null>;
110
110
 
111
- export { type AllocatableResource as A, BULLETIN_RESOURCE as B, DEFAULT_RESOURCES as D, type OnExistingAllowancePolicy as O, type ResourceTag as R, type AllocationOutcome as a, type AllocationSummary as b, createSlotAccountSigner as c, requestResourceAllocation as r, summarizeOutcomes as s };
111
+ export { type AllocatableResource, type AllocationOutcome, type AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, type OnExistingAllowancePolicy, type ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes };
@@ -0,0 +1,14 @@
1
+ import {
2
+ BULLETIN_RESOURCE,
3
+ DEFAULT_RESOURCES,
4
+ createSlotAccountSigner,
5
+ requestResourceAllocation,
6
+ summarizeOutcomes
7
+ } from "../../chunk-7SXO544V.js";
8
+ export {
9
+ BULLETIN_RESOURCE,
10
+ DEFAULT_RESOURCES,
11
+ createSlotAccountSigner,
12
+ requestResourceAllocation,
13
+ summarizeOutcomes
14
+ };
@@ -1,30 +1,7 @@
1
1
  import { TerminalAdapter, UserSession } from '@parity/product-sdk-terminal';
2
2
  import { PolkadotSigner } from 'polkadot-api';
3
- import { A as AllocatableResource, O as OnExistingAllowancePolicy, a as AllocationOutcome } from './allocations-CEPeZr6T.js';
4
-
5
- /**
6
- * Per-product configuration injected into `createAuthClient`. Lifting the
7
- * sign-in glue out of playground-cli (issue #411) means the env-specific
8
- * constants playground hard-coded in its `config.ts` (DAPP_ID, product id,
9
- * metadata URL, People-chain endpoints) become consumer-supplied so the same
10
- * package serves `playground` and `dot` (and future products) unchanged.
11
- */
12
- interface AuthConfig {
13
- /** The dApp identity string. Scopes the on-disk session namespace
14
- * (`~/.polkadot-apps/${dappId}_*`) and the SSO pairing — each product
15
- * gets its own, independently-revocable session. */
16
- dappId: string;
17
- /** Product id used to derive the product account (`/product/{productId}/{index}`). */
18
- productId: string;
19
- /** Derivation index of the product account (0 = default). */
20
- derivationIndex: number;
21
- /** Wallet-facing app name shown on the Sign-In screen (sent inline at pairing). */
22
- hostName: string;
23
- /** Host app version sent inline at pairing. */
24
- hostVersion: string;
25
- /** People-parachain RPC endpoints the terminal adapter connects to. */
26
- peopleEndpoints: string[];
27
- }
3
+ import { AllocatableResource, OnExistingAllowancePolicy, AllocationOutcome } from './allocations.js';
4
+ import { AuthConfig } from './types.js';
28
5
 
29
6
  /**
30
7
  * The three addresses we surface from a paired session.
@@ -125,4 +102,4 @@ interface AuthClient {
125
102
  */
126
103
  declare function createAuthClient(config: AuthConfig): AuthClient;
127
104
 
128
- export { type AuthClient as A, type ConnectResult as C, type LoginHandle as L, type SessionAddresses as S, type AuthConfig as a, type LoginStatus as b, type LogoutHandle as c, type LogoutStatus as d, type SessionHandle as e, createAuthClient as f };
105
+ export { type AuthClient, type ConnectResult, type LoginHandle, type LoginStatus, type LogoutHandle, type LogoutStatus, type SessionAddresses, type SessionHandle, createAuthClient };
@@ -0,0 +1,10 @@
1
+ import {
2
+ createAuthClient
3
+ } from "../../chunk-G7EH3XIW.js";
4
+ import "../../chunk-7SXO544V.js";
5
+ import "../../chunk-S6CPT2TU.js";
6
+ import "../../chunk-SH2LG52Z.js";
7
+ import "../../chunk-DNXE3Q5D.js";
8
+ export {
9
+ createAuthClient
10
+ };
@@ -1,32 +1,8 @@
1
- export { A as AuthClient, a as AuthConfig, C as ConnectResult, L as LoginHandle, b as LoginStatus, c as LogoutHandle, d as LogoutStatus, S as SessionAddresses, e as SessionHandle, f as createAuthClient } from '../../auth-CA_YKtM2.js';
2
- import { UserSession } from '@parity/product-sdk-terminal';
3
- import { PolkadotSigner } from 'polkadot-api';
4
- export { R as ResolvedSigner, S as SignerNotAvailableError, a as SignerOptions, b as SignerSource, p as parseDevAccountName, r as resolveSigner } from '../../signer-Duup0hgQ.js';
5
- export { A as AllocatableResource, a as AllocationOutcome, b as AllocationSummary, B as BULLETIN_RESOURCE, D as DEFAULT_RESOURCES, O as OnExistingAllowancePolicy, R as ResourceTag, c as createSlotAccountSigner, r as requestResourceAllocation, s as summarizeOutcomes } from '../../allocations-CEPeZr6T.js';
1
+ export { AuthClient, ConnectResult, LoginHandle, LoginStatus, LogoutHandle, LogoutStatus, SessionAddresses, SessionHandle, createAuthClient } from './auth.js';
2
+ export { INCOMPLETE_SESSION_MESSAGE, ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey } from './sessionSigner.js';
3
+ export { ResolvedSigner, SignerNotAvailableError, SignerOptions, SignerSource, parseDevAccountName, resolveSigner } from './signer.js';
4
+ export { AllocatableResource, AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, OnExistingAllowancePolicy, ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './allocations.js';
5
+ export { AuthConfig } from './types.js';
6
+ import '@parity/product-sdk-terminal';
7
+ import 'polkadot-api';
6
8
  import '@parity/product-sdk-tx';
7
-
8
- interface ProductAccountRef {
9
- productId: string;
10
- derivationIndex: number;
11
- }
12
- declare const INCOMPLETE_SESSION_MESSAGE = "Stored login session is missing the root account public key. Run \"logout\" and then \"login\" to pair again.";
13
- declare function sessionRootPublicKey(session: UserSession): Uint8Array;
14
- /**
15
- * Soft-derive the product account public key off a wallet root.
16
- *
17
- * This is the single source of truth for product-account math. Both
18
- * `createSessionSigner` (which builds the signer used to actually sign
19
- * on-chain) and `deriveSessionAddresses` (which builds the display triple)
20
- * go through here so a future change to derivation params can't silently
21
- * desync the signer from what we print.
22
- *
23
- * sr25519 soft derivation is composable on public keys alone, so deriving
24
- * from `rootAccountId` locally produces the SAME public key the mobile
25
- * derives privately via `mnemonic + "/product/...{idx}"`. Algorithm parity
26
- * with mobile/desktop is locked by the frozen vectors in
27
- * `@parity/product-sdk-keys`'s `product-account.test.ts`.
28
- */
29
- declare function deriveProductPublicKey(rootAccountId: Uint8Array, ref: ProductAccountRef): Uint8Array;
30
- declare function createSessionSigner(session: UserSession, ref: ProductAccountRef): PolkadotSigner;
31
-
32
- export { INCOMPLETE_SESSION_MESSAGE, type ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey };
@@ -1,20 +1,27 @@
1
+ import "../../chunk-NJKXXDDK.js";
2
+ import {
3
+ createAuthClient
4
+ } from "../../chunk-G7EH3XIW.js";
1
5
  import {
2
6
  BULLETIN_RESOURCE,
3
7
  DEFAULT_RESOURCES,
8
+ createSlotAccountSigner,
9
+ requestResourceAllocation,
10
+ summarizeOutcomes
11
+ } from "../../chunk-7SXO544V.js";
12
+ import {
4
13
  INCOMPLETE_SESSION_MESSAGE,
5
- SignerNotAvailableError,
6
- createAuthClient,
7
14
  createSessionSigner,
8
- createSlotAccountSigner,
9
15
  deriveProductPublicKey,
16
+ sessionRootPublicKey
17
+ } from "../../chunk-S6CPT2TU.js";
18
+ import {
19
+ SignerNotAvailableError,
10
20
  parseDevAccountName,
11
- requestResourceAllocation,
12
- resolveSigner,
13
- sessionRootPublicKey,
14
- summarizeOutcomes
15
- } from "../../chunk-H44NO63C.js";
16
- import "../../chunk-TSPERKUS.js";
21
+ resolveSigner
22
+ } from "../../chunk-2C6SLLBI.js";
17
23
  import "../../chunk-SH2LG52Z.js";
24
+ import "../../chunk-DNXE3Q5D.js";
18
25
  export {
19
26
  BULLETIN_RESOURCE,
20
27
  DEFAULT_RESOURCES,
@@ -0,0 +1,28 @@
1
+ import { UserSession } from '@parity/product-sdk-terminal';
2
+ import { PolkadotSigner } from 'polkadot-api';
3
+
4
+ interface ProductAccountRef {
5
+ productId: string;
6
+ derivationIndex: number;
7
+ }
8
+ declare const INCOMPLETE_SESSION_MESSAGE = "Stored login session is missing the root account public key. Run \"logout\" and then \"login\" to pair again.";
9
+ declare function sessionRootPublicKey(session: UserSession): Uint8Array;
10
+ /**
11
+ * Soft-derive the product account public key off a wallet root.
12
+ *
13
+ * This is the single source of truth for product-account math. Both
14
+ * `createSessionSigner` (which builds the signer used to actually sign
15
+ * on-chain) and `deriveSessionAddresses` (which builds the display triple)
16
+ * go through here so a future change to derivation params can't silently
17
+ * desync the signer from what we print.
18
+ *
19
+ * sr25519 soft derivation is composable on public keys alone, so deriving
20
+ * from `rootAccountId` locally produces the SAME public key the mobile
21
+ * derives privately via `mnemonic + "/product/...{idx}"`. Algorithm parity
22
+ * with mobile/desktop is locked by the frozen vectors in
23
+ * `@parity/product-sdk-keys`'s `product-account.test.ts`.
24
+ */
25
+ declare function deriveProductPublicKey(rootAccountId: Uint8Array, ref: ProductAccountRef): Uint8Array;
26
+ declare function createSessionSigner(session: UserSession, ref: ProductAccountRef): PolkadotSigner;
27
+
28
+ export { INCOMPLETE_SESSION_MESSAGE, type ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey };
@@ -0,0 +1,14 @@
1
+ import {
2
+ INCOMPLETE_SESSION_MESSAGE,
3
+ createSessionSigner,
4
+ deriveProductPublicKey,
5
+ sessionRootPublicKey
6
+ } from "../../chunk-S6CPT2TU.js";
7
+ import "../../chunk-SH2LG52Z.js";
8
+ import "../../chunk-DNXE3Q5D.js";
9
+ export {
10
+ INCOMPLETE_SESSION_MESSAGE,
11
+ createSessionSigner,
12
+ deriveProductPublicKey,
13
+ sessionRootPublicKey
14
+ };
@@ -1,6 +1,9 @@
1
1
  import { DevAccountName } from '@parity/product-sdk-tx';
2
2
  import { PolkadotSigner } from 'polkadot-api';
3
- import { e as SessionHandle, S as SessionAddresses, A as AuthClient } from './auth-CA_YKtM2.js';
3
+ import { SessionHandle, SessionAddresses, AuthClient } from './auth.js';
4
+ import '@parity/product-sdk-terminal';
5
+ import './allocations.js';
6
+ import './types.js';
4
7
 
5
8
  type SignerSource = "dev" | "session";
6
9
  interface ResolvedSigner {
@@ -32,4 +35,4 @@ declare function parseDevAccountName(suri: string): DevAccountName | null;
32
35
  */
33
36
  declare function resolveSigner(authClient: AuthClient, options?: SignerOptions): Promise<ResolvedSigner>;
34
37
 
35
- export { type ResolvedSigner as R, SignerNotAvailableError as S, type SignerOptions as a, type SignerSource as b, parseDevAccountName as p, resolveSigner as r };
38
+ export { type ResolvedSigner, SignerNotAvailableError, type SignerOptions, type SignerSource, parseDevAccountName, resolveSigner };
@@ -0,0 +1,10 @@
1
+ import {
2
+ SignerNotAvailableError,
3
+ parseDevAccountName,
4
+ resolveSigner
5
+ } from "../../chunk-2C6SLLBI.js";
6
+ export {
7
+ SignerNotAvailableError,
8
+ parseDevAccountName,
9
+ resolveSigner
10
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Per-product configuration injected into `createAuthClient`. Lifting the
3
+ * sign-in glue out of playground-cli (issue #411) means the env-specific
4
+ * constants playground hard-coded in its `config.ts` (DAPP_ID, product id,
5
+ * metadata URL, People-chain endpoints) become consumer-supplied so the same
6
+ * package serves `playground` and `dot` (and future products) unchanged.
7
+ */
8
+ interface AuthConfig {
9
+ /** The dApp identity string. Scopes the on-disk session namespace
10
+ * (`~/.polkadot-apps/${dappId}_*`) and the SSO pairing — each product
11
+ * gets its own, independently-revocable session. */
12
+ dappId: string;
13
+ /** Product id used to derive the product account (`/product/{productId}/{index}`). */
14
+ productId: string;
15
+ /** Derivation index of the product account (0 = default). */
16
+ derivationIndex: number;
17
+ /** Wallet-facing app name shown on the Sign-In screen (sent inline at pairing). */
18
+ hostName: string;
19
+ /** Host app version sent inline at pairing. */
20
+ hostVersion: string;
21
+ /** People-parachain RPC endpoints the terminal adapter connects to. */
22
+ peopleEndpoints: string[];
23
+ }
24
+
25
+ export type { AuthConfig };
File without changes
@@ -1,15 +1,6 @@
1
1
  export { renderQrCode } from '@parity/product-sdk-terminal';
2
- import { b as LoginStatus, d as LogoutStatus } from '../../../auth-CA_YKtM2.js';
2
+ export { renderLoginStatus, renderLogoutStatus } from './status.js';
3
+ import '../auth.js';
3
4
  import 'polkadot-api';
4
- import '../../../allocations-CEPeZr6T.js';
5
-
6
- /**
7
- * Pure formatters that map the `LoginStatus` / `LogoutStatus` streams to
8
- * one-line terminal messages. No I/O, no terminal deps — `import type` only,
9
- * so this module stays unit-testable without the SSO stack.
10
- */
11
-
12
- declare function renderLoginStatus(status: LoginStatus): string;
13
- declare function renderLogoutStatus(status: LogoutStatus): string;
14
-
15
- export { renderLoginStatus, renderLogoutStatus };
5
+ import '../allocations.js';
6
+ import '../types.js';
@@ -1,8 +1,11 @@
1
+ import "../../../chunk-DFKEG3WY.js";
1
2
  import {
2
- renderLoginStatus,
3
- renderLogoutStatus,
4
3
  renderQrCode
5
- } from "../../../chunk-RIRDBSBG.js";
4
+ } from "../../../chunk-RPBMNTGZ.js";
5
+ import {
6
+ renderLoginStatus,
7
+ renderLogoutStatus
8
+ } from "../../../chunk-YP3LINCF.js";
6
9
  export {
7
10
  renderLoginStatus,
8
11
  renderLogoutStatus,
@@ -0,0 +1 @@
1
+ export { renderQrCode } from '@parity/product-sdk-terminal';
@@ -0,0 +1,6 @@
1
+ import {
2
+ renderQrCode
3
+ } from "../../../chunk-RPBMNTGZ.js";
4
+ export {
5
+ renderQrCode
6
+ };
@@ -0,0 +1,16 @@
1
+ import '@parity/product-sdk-terminal';
2
+ import { LoginStatus, LogoutStatus } from '../auth.js';
3
+ import 'polkadot-api';
4
+ import '../allocations.js';
5
+ import '../types.js';
6
+
7
+ /**
8
+ * Pure formatters that map the `LoginStatus` / `LogoutStatus` streams to
9
+ * one-line terminal messages. No I/O, no terminal deps — `import type` only,
10
+ * so this module stays unit-testable without the SSO stack.
11
+ */
12
+
13
+ declare function renderLoginStatus(status: LoginStatus): string;
14
+ declare function renderLogoutStatus(status: LogoutStatus): string;
15
+
16
+ export { renderLoginStatus, renderLogoutStatus };
@@ -0,0 +1,8 @@
1
+ import {
2
+ renderLoginStatus,
3
+ renderLogoutStatus
4
+ } from "../../../chunk-YP3LINCF.js";
5
+ export {
6
+ renderLoginStatus,
7
+ renderLogoutStatus
8
+ };
@@ -1,8 +1,9 @@
1
- import { a as AuthConfig, A as AuthClient } from './auth-CA_YKtM2.js';
1
+ import { AuthClient } from './auth/vendor/auth.js';
2
+ import { AuthConfig } from './auth/vendor/types.js';
2
3
  import { EnvironmentsDoc } from './environments.js';
3
4
  import '@parity/product-sdk-terminal';
4
5
  import 'polkadot-api';
5
- import './allocations-CEPeZr6T.js';
6
+ import './auth/vendor/allocations.js';
6
7
 
7
8
  /** dApp identity: scopes the SSO session namespace + terminal allowance cache on disk
8
9
  * and the wallet pairing product. Aligned to the app's dedicated id "polkadot-app-deploy". */
@@ -24,6 +25,14 @@ declare const DOT_HOST_NAME = "polkadot-app-deploy";
24
25
  * The adapter silently returns [] in this case; we surface the cause and recovery steps.
25
26
  */
26
27
  declare const STALE_SESSION_MESSAGE: string;
28
+ /**
29
+ * Deploy-specific variant of STALE_SESSION_MESSAGE. See src/deploy-actors.ts's
30
+ * resolveDeployActors for the full rationale (issue #234) — in short, `deploy`
31
+ * has a remedy `whoami` doesn't: an explicit `--mnemonic` / `MNEMONIC` signer,
32
+ * which wins even when the persisted session can't be read. Naming it here
33
+ * means the fail-fast error doesn't just point at re-pairing.
34
+ */
35
+ declare const STALE_SESSION_DEPLOY_MESSAGE = "Stored login session could not be read \u2014 it may have been written by an older version. Run \"bulletin-deploy logout\", then \"bulletin-deploy login\" to pair again. Or pass --mnemonic explicitly to sign with a different key.";
27
36
  /**
28
37
  * Returns true if there is a persisted SSO session file on disk.
29
38
  * Does NOT load the SSO stack — uses only node fs/os/path.
@@ -63,4 +72,4 @@ declare function getPeopleChainEndpoints(envId: string): Promise<string[]>;
63
72
  */
64
73
  declare function getAuthClient(envId: string): Promise<AuthClient>;
65
74
 
66
- export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, DOT_PRODUCT_ID, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, resolveBulletinEndpoints };
75
+ export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, DOT_PRODUCT_ID, STALE_SESSION_DEPLOY_MESSAGE, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, resolveBulletinEndpoints };
@@ -3,23 +3,25 @@ import {
3
3
  DOT_DERIVATION_INDEX,
4
4
  DOT_HOST_NAME,
5
5
  DOT_PRODUCT_ID,
6
+ STALE_SESSION_DEPLOY_MESSAGE,
6
7
  STALE_SESSION_MESSAGE,
7
8
  buildAuthConfig,
8
9
  getAuthClient,
9
10
  getPeopleChainEndpoints,
10
11
  hasPersistedSession,
11
12
  resolveBulletinEndpoints
12
- } from "./chunk-U2QO5G35.js";
13
- import "./chunk-TSPERKUS.js";
13
+ } from "./chunk-PH65V5GG.js";
14
14
  import "./chunk-3NR3T7US.js";
15
- import "./chunk-BFK5UCUJ.js";
16
- import "./chunk-OONQPYHM.js";
15
+ import "./chunk-KJGXS3AY.js";
16
+ import "./chunk-DDSBHHGU.js";
17
17
  import "./chunk-SH2LG52Z.js";
18
+ import "./chunk-DNXE3Q5D.js";
18
19
  export {
19
20
  DOT_DAPP_ID,
20
21
  DOT_DERIVATION_INDEX,
21
22
  DOT_HOST_NAME,
22
23
  DOT_PRODUCT_ID,
24
+ STALE_SESSION_DEPLOY_MESSAGE,
23
25
  STALE_SESSION_MESSAGE,
24
26
  buildAuthConfig,
25
27
  getAuthClient,
@@ -10,10 +10,10 @@ import {
10
10
  offerBugReport,
11
11
  scrubSecrets,
12
12
  setDeployContext
13
- } from "./chunk-UFP2XWZ4.js";
14
- import "./chunk-R3BXRRKE.js";
15
- import "./chunk-BFK5UCUJ.js";
16
- import "./chunk-OONQPYHM.js";
13
+ } from "./chunk-UEAWWSKI.js";
14
+ import "./chunk-KHASCR2I.js";
15
+ import "./chunk-KJGXS3AY.js";
16
+ import "./chunk-DDSBHHGU.js";
17
17
  import "./chunk-SH2LG52Z.js";
18
18
  export {
19
19
  buildCliFlagsSummary,
@@ -3,9 +3,9 @@ import {
3
3
  DEFAULT_WINDOW_BLOCKS,
4
4
  MAX_SPANS_PER_SAMPLER,
5
5
  endpointHost
6
- } from "./chunk-CCIBF55X.js";
7
- import "./chunk-BFK5UCUJ.js";
8
- import "./chunk-OONQPYHM.js";
6
+ } from "./chunk-ZN7PPHMX.js";
7
+ import "./chunk-KJGXS3AY.js";
8
+ import "./chunk-DDSBHHGU.js";
9
9
  import "./chunk-SH2LG52Z.js";
10
10
  export {
11
11
  ChainHealthSampler,