@le-space/playwright 0.12.3 → 0.12.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.
package/README.md CHANGED
@@ -42,4 +42,7 @@ account is not being used concurrently.
42
42
  `selectExpiredAlephPlaywrightRunners()` is the safety boundary used by the
43
43
  retention janitor. The repository script requires an explicit repository scope
44
44
  and owner key, then erases, owner-signs FORGET for, and verifies each selected
45
- exact INSTANCE hash. It never cleans by display name alone.
45
+ exact INSTANCE hash. It never cleans by display name alone. `keepNamePrefixes`
46
+ names long-lived instances the same wallet funds on purpose; they are retained
47
+ with the reason `ALEPH_RUNNER_KEPT_REASON` and never count as unswept, and a keep
48
+ prefix that overlaps a sweep prefix throws.
package/index.d.ts CHANGED
@@ -107,6 +107,8 @@ interface AlephRunnerJanitorSelection {
107
107
  ageMs: number;
108
108
  }>;
109
109
  }
110
+ /** Why a long-lived instance named by a keep prefix stays untouched. */
111
+ declare const ALEPH_RUNNER_KEPT_REASON = "kept long-lived instance";
110
112
  interface RelayAddressPolicy {
111
113
  allowWebTransport?: boolean;
112
114
  allowWebRtcDirect?: boolean;
@@ -231,6 +233,14 @@ declare function selectExpiredAlephPlaywrightRunners(options: {
231
233
  * repository prefix and so leaked forever (#88).
232
234
  */
233
235
  additionalNamePrefixes?: readonly string[];
236
+ /**
237
+ * Exact name prefixes of long-lived instances the same wallet funds on
238
+ * purpose — a production relay deployed from the E2E account. They are
239
+ * never swept and never reported as unswept, so `fail_on_unswept` can stay
240
+ * on for everything else. A prefix that a sweep prefix would also match is
241
+ * refused: a name must not be both expendable and kept.
242
+ */
243
+ keepNamePrefixes?: readonly string[];
234
244
  }): AlephRunnerJanitorSelection;
235
245
  declare function waitForPubsubSubscriber(page: Page, options: WaitForPubsubSubscriberOptions): Promise<string[]>;
236
246
  /**
@@ -410,4 +420,4 @@ declare function createRelayTest(options: CreateRelayTestOptions): _playwright_t
410
420
  relayLifecycle: RelayLifecycleFixture;
411
421
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions>;
412
422
 
413
- export { type AlephChromiumConnector, type AlephCostEvidence, type AlephCreditBalanceSnapshot, type AlephPricingSnapshot, type AlephRemoteBrowserOptions, type AlephRunnerInstanceCandidate, type AlephRunnerJanitorSelection, type CleanupRelayHooks, type CleanupRelayOptions, type CleanupRelayResult, type CreateRelayTestOptions, DEFAULT_ALEPH_SCHEDULER_URL, type ForwardBrowserConsoleOptions, LIBP2P_DIAGNOSTIC_CONSOLE_FILTER, PLAYWRIGHT_RUNNER_VERSION, type ProgressLogger, type ProvisionRelayOptions, type ProvisionedRelay, type RelayAddressPolicy, RelayButtonDriver, type RelayButtonDriverOptions, type RelayEvidence, type RelayEvidenceStep, type RelayLifecycleFixture, type RelayWalletAccount, SUPPORTED_ALEPH_API_HOSTS, type WaitForPubsubSubscriberOptions, appendRelayGithubSummary, buildAlephCostEvidence, cleanupRelay, connectAlephChromium, createProgressLogger, createRelayEvidence, createRelayTest, findAlephInstanceHash, formatAlephCostGithubSummary, formatRelayGithubSummary, forwardBrowserConsole, installEip1193WalletMock, provisionRelay, resolveAlephApiHosts, resolveAlephMessageSender, selectBrowserRelayAddresses, selectExpiredAlephPlaywrightRunners, updateRelayEvidenceStep, waitForAlephInstanceDeletion, waitForAlephMessageForgotten, waitForBootstrapRegistration, waitForDeployableManifest, waitForPubsubSubscriber, writeRelayEvidence };
423
+ export { ALEPH_RUNNER_KEPT_REASON, type AlephChromiumConnector, type AlephCostEvidence, type AlephCreditBalanceSnapshot, type AlephPricingSnapshot, type AlephRemoteBrowserOptions, type AlephRunnerInstanceCandidate, type AlephRunnerJanitorSelection, type CleanupRelayHooks, type CleanupRelayOptions, type CleanupRelayResult, type CreateRelayTestOptions, DEFAULT_ALEPH_SCHEDULER_URL, type ForwardBrowserConsoleOptions, LIBP2P_DIAGNOSTIC_CONSOLE_FILTER, PLAYWRIGHT_RUNNER_VERSION, type ProgressLogger, type ProvisionRelayOptions, type ProvisionedRelay, type RelayAddressPolicy, RelayButtonDriver, type RelayButtonDriverOptions, type RelayEvidence, type RelayEvidenceStep, type RelayLifecycleFixture, type RelayWalletAccount, SUPPORTED_ALEPH_API_HOSTS, type WaitForPubsubSubscriberOptions, appendRelayGithubSummary, buildAlephCostEvidence, cleanupRelay, connectAlephChromium, createProgressLogger, createRelayEvidence, createRelayTest, findAlephInstanceHash, formatAlephCostGithubSummary, formatRelayGithubSummary, forwardBrowserConsole, installEip1193WalletMock, provisionRelay, resolveAlephApiHosts, resolveAlephMessageSender, selectBrowserRelayAddresses, selectExpiredAlephPlaywrightRunners, updateRelayEvidenceStep, waitForAlephInstanceDeletion, waitForAlephMessageForgotten, waitForBootstrapRegistration, waitForDeployableManifest, waitForPubsubSubscriber, writeRelayEvidence };
package/index.js CHANGED
@@ -67,6 +67,7 @@ async function waitForAlephInstanceDeletion(options) {
67
67
 
68
68
  // src/index.ts
69
69
  var PLAYWRIGHT_RUNNER_VERSION = "1.61.1";
70
+ var ALEPH_RUNNER_KEPT_REASON = "kept long-lived instance";
70
71
  function requireFiniteNumber(value, label) {
71
72
  const number = Number(value);
72
73
  if (!Number.isFinite(number)) throw new Error(`${label} must be a finite number`);
@@ -160,6 +161,9 @@ function selectExpiredAlephPlaywrightRunners(options) {
160
161
  `playwright-${repository}-`,
161
162
  ...(options.additionalNamePrefixes ?? []).map((value) => value.trim().toLowerCase()).filter(Boolean)
162
163
  ];
164
+ const keep = (options.keepNamePrefixes ?? []).map((value) => value.trim().toLowerCase()).filter(Boolean);
165
+ const overlap = keep.filter((kept) => prefixes.some((swept) => kept.startsWith(swept) || swept.startsWith(kept)));
166
+ if (overlap.length) throw new Error(`Janitor keep prefixes overlap the sweep prefixes: ${overlap.join(", ")}`);
163
167
  const now = options.now ?? Date.now();
164
168
  const ttlMs = options.ttlMs ?? 60 * 6e4;
165
169
  if (!Number.isFinite(ttlMs) || ttlMs < 15 * 6e4) throw new Error("Janitor TTL must be at least 15 minutes");
@@ -169,6 +173,8 @@ function selectExpiredAlephPlaywrightRunners(options) {
169
173
  const createdAt = Date.parse(candidate.createdAt);
170
174
  if (!/^[a-f0-9]{64}$/iu.test(candidate.itemHash)) reason = "invalid exact INSTANCE hash";
171
175
  else if (candidate.ownerAddress.toLowerCase() !== owner) reason = "different owner";
176
+ else if (keep.some((prefix) => candidate.instanceName.toLowerCase().startsWith(prefix)))
177
+ reason = ALEPH_RUNNER_KEPT_REASON;
172
178
  else if (!prefixes.some((prefix) => candidate.instanceName.toLowerCase().startsWith(prefix)))
173
179
  reason = "name outside repository scope";
174
180
  else if (!Number.isFinite(createdAt)) reason = "invalid creation timestamp";
@@ -922,6 +928,7 @@ function createRelayTest(options) {
922
928
  });
923
929
  }
924
930
  export {
931
+ ALEPH_RUNNER_KEPT_REASON,
925
932
  DEFAULT_ALEPH_SCHEDULER_URL,
926
933
  LIBP2P_DIAGNOSTIC_CONSOLE_FILTER,
927
934
  PLAYWRIGHT_RUNNER_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/playwright",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "description": "Reusable Playwright fixtures and Relay Button lifecycle helpers.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,8 +27,8 @@
27
27
  "url": "https://github.com/NiKrause/relay-button/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@le-space/aleph-bootstrap": "0.12.3",
31
- "@le-space/core": "0.12.3"
30
+ "@le-space/aleph-bootstrap": "0.12.5",
31
+ "@le-space/core": "0.12.5"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@playwright/test": ">=1.61.1 <1.62.0"