extension-develop 4.0.18 → 4.0.19-canary.1785200797.ce99a79e

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.
@@ -14,7 +14,7 @@ import node_fs from "node:fs";
14
14
  import node_path from "node:path";
15
15
  import { isResourceUnderDirs, canonicalizeDir, toResourceKey } from "./93.mjs";
16
16
  import { prefix as messaging_prefix, isDebug } from "./349.mjs";
17
- import { debugExtensionsToLoad, package_namespaceObject, getDirs, asAbsolute, browserRunnerDisabled, packagingDistributionFiles, PlaywrightPlugin, toPosixPath, resolveCompanionExtensionDirs, debugContextPath, isGeckoBasedBrowser, spacerLine, messages_ready, CHROMIUM_FAMILY_ALIASES, treeWithSourceAndDistFiles, treeWithDistFilesbrowser, computeExtensionsToLoad, noCompanionExtensionsResolved, treeWithSourceFiles, bundlerFatalError, bundlerRecompiling, noEntrypointsDetected, GECKO_FAMILY_ALIASES, packagingSourceFiles, debugBrowser, debugOutputPath, manifestInvalidJson, isChromiumBasedBrowser, getSpecialFoldersDataForCompiler } from "./101.mjs";
17
+ import { debugExtensionsToLoad, package_namespaceObject, getDirs, asAbsolute, browserRunnerDisabled, treeWithDistFilesBrowser, packagingDistributionFiles, toPosixPath, PlaywrightPlugin, debugContextPath, resolveCompanionExtensionDirs, isGeckoBasedBrowser, spacerLine, messages_ready, CHROMIUM_FAMILY_ALIASES, treeWithSourceAndDistFiles, computeExtensionsToLoad, noCompanionExtensionsResolved, treeWithSourceFiles, bundlerFatalError, bundlerRecompiling, noEntrypointsDetected, GECKO_FAMILY_ALIASES, packagingSourceFiles, debugBrowser, debugOutputPath, manifestInvalidJson, isChromiumBasedBrowser, getSpecialFoldersDataForCompiler } from "./101.mjs";
18
18
  import { unixify as paths_unixify, getManifestOverrides, isUsingTypeScript, resolvePackageManager, jsFrameworksIntegrationsEnabled, resolveRootAbsoluteRef, isStaticThemeSource, buildCanonicalManifest, getCurrentManifestContent, ensureTypeScriptConfig, resolveDevelopInstallRoot, filterKeysForThisBrowser as manifest_utils_filterKeysForThisBrowser, isUsingCustomLoader, getUserTypeScriptConfigFile, isUsingIntegration as messages_isUsingIntegration, reportToCompilation, normalizeManifestOutputPath, jsFrameworksHmrSummary, ReloadPlugin, humanLine, jsFrameworksConfigsDetected, collectRootAbsoluteRefs, getManifestContent, resolveDevelopDistFile, hasDependency, setOriginalManifestContent, isFromFilepathList, setCurrentManifestContent } from "./839.mjs";
19
19
  import { scrubBrand, makeSanitizedConsole } from "./0~branding.mjs";
20
20
  import { stripBom, parseJsonSafe } from "./23.mjs";
@@ -614,6 +614,11 @@ function resolveManifestName(rawName, manifest, searchRoots, fallback) {
614
614
  return fallback;
615
615
  }
616
616
  const toPosix = (p)=>p.replace(/\\/g, '/');
617
+ const COMPANION_DIR = 'extensions';
618
+ function isCompanionExtension(file) {
619
+ const [first] = toPosix(file).split('/');
620
+ return first === COMPANION_DIR;
621
+ }
617
622
  async function getFilesToZip(projectDir) {
618
623
  const gitignorePath = __rspack_external_node_path_c5b9b54f.join(projectDir, '.gitignore');
619
624
  const ig = ignore();
@@ -625,7 +630,7 @@ async function getFilesToZip(projectDir) {
625
630
  cwd: projectDir,
626
631
  dot: true
627
632
  });
628
- return files.filter((file)=>!ig.ignores(file));
633
+ return files.filter((file)=>!ig.ignores(file) && !isCompanionExtension(file));
629
634
  }
630
635
  class ZipPlugin {
631
636
  options;
@@ -688,7 +693,7 @@ class ZipPlugin {
688
693
  const distItem = created.find((c)=>'dist' === c.kind);
689
694
  if (sourceItem && distItem) console.log(treeWithSourceAndDistFiles(this.browser, name, sourceItem.path, distItem.path));
690
695
  else if (sourceItem) console.log(treeWithSourceFiles(name, 'zip', this.browser, sourceItem.path));
691
- else if (distItem) console.log(treeWithDistFilesbrowser(name, 'zip', this.browser, distItem.path));
696
+ else if (distItem) console.log(treeWithDistFilesBrowser(name, 'zip', this.browser, distItem.path));
692
697
  }
693
698
  } catch (error) {
694
699
  if (stats?.compilation?.warnings) stats.compilation.warnings.push(new Error(`ZipPlugin: Failed to create zip(s): ${String(error)}`));
package/dist/101.mjs CHANGED
@@ -214,7 +214,7 @@ function packagingDistributionFiles(zipPath) {
214
214
  function treeWithSourceAndDistFiles(browser, name, sourceZip, destZip) {
215
215
  return `${messaging_prefix('debug')} zip name=${name} browser=${String(browser)} source=${sourceZip} dist=${destZip}`;
216
216
  }
217
- function treeWithDistFilesbrowser(name, ext, browser, zipPath) {
217
+ function treeWithDistFilesBrowser(name, ext, browser, zipPath) {
218
218
  return `${messaging_prefix('debug')} zip name=${name}.${ext} browser=${String(browser)} dist=${zipPath}`;
219
219
  }
220
220
  function treeWithSourceFiles(name, ext, browser, zipPath) {
@@ -643,7 +643,7 @@ async function config_loader_isUsingExperimentalConfig(projectPath) {
643
643
  }
644
644
  return false;
645
645
  }
646
- var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.0.18","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.1.1","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","acorn":"^8.16.0","adm-zip":"^0.6.0","browser-extension-manifest-fields":"^2.2.9","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","dotenv":"^17.2.3","es-module-lexer":"^2.1.0","extension-from-store":"^0.1.1","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.6.7","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.18","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.20.1"}}');
646
+ var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.0.19-canary.1785200797.ce99a79e","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.1.1","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","acorn":"^8.16.0","adm-zip":"^0.6.0","browser-extension-manifest-fields":"^2.2.9","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","dotenv":"^17.2.3","es-module-lexer":"^2.1.0","extension-from-store":"^0.1.1","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.6.7","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.18","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.20.1"}}');
647
647
  function asAbsolute(p) {
648
648
  return __rspack_external_node_path_c5b9b54f.isAbsolute(p) ? p : __rspack_external_node_path_c5b9b54f.resolve(p);
649
649
  }
@@ -2234,4 +2234,4 @@ async function extensionPreview(pathOrRemoteUrl, previewOptions, browserLauncher
2234
2234
  await browserLauncher(resolvedOpts);
2235
2235
  metadata.writeReady();
2236
2236
  }
2237
- export { CHROMIUM_FAMILY_ALIASES, GECKO_FAMILY_ALIASES, PlaywrightPlugin, asAbsolute, assertNoManagedDependencyConflicts, authorInstallNotice, autoExitForceKill, autoExitModeEnabled, autoExitTriggered, browserLaunchFailed, browserRunnerDisabled, buildCommandFailed, buildSuccess, buildSuccessWithWarnings, buildWarningsDetails, buildWebpack, bundlerFatalError, bundlerRecompiling, computeExtensionsToLoad, createPlaywrightMetadataWriter, debugBrowser, debugContextPath, debugDirs, debugExtensionsToLoad, debugOutputPath, devCommandFailed, devServerStartTimeout, downloadingText, extensionJsRunnerError, extensionLoadRecovered, extensionLoadStillRefused, extensionPreview, failedToDownloadOrExtractZIPFileError, getDirs, getDistPath, getProjectStructure, getSessionRunId, getSpecialFoldersDataForCompiler, getSpecialFoldersDataForProjectRoot, invalidRemoteZip, isChromiumBasedBrowser, isGeckoBasedBrowser, loadBrowserConfig, loadCommandConfig, loadCustomConfig, localZipNotFound, manifestInvalidJson, messages_ready, needsInstall, noCompanionExtensionsResolved, noEntrypointsDetected, normalizeBrowser, notAZipArchive, package_namespaceObject, packagingDistributionFiles, packagingSourceFiles, portInUse, projectInstallFallbackToNpm, projectInstallScriptsDisabled, resolveCompanionExtensionDirs, resolveCompanionExtensionsConfig, sanitize, spacerLine, toPosixPath, treeWithDistFilesbrowser, treeWithSourceAndDistFiles, treeWithSourceFiles, unpackagedSuccessfully, unpackagingExtension, writingTypeDefinitions, writingTypeDefinitionsError };
2237
+ export { CHROMIUM_FAMILY_ALIASES, GECKO_FAMILY_ALIASES, PlaywrightPlugin, asAbsolute, assertNoManagedDependencyConflicts, authorInstallNotice, autoExitForceKill, autoExitModeEnabled, autoExitTriggered, browserLaunchFailed, browserRunnerDisabled, buildCommandFailed, buildSuccess, buildSuccessWithWarnings, buildWarningsDetails, buildWebpack, bundlerFatalError, bundlerRecompiling, computeExtensionsToLoad, createPlaywrightMetadataWriter, debugBrowser, debugContextPath, debugDirs, debugExtensionsToLoad, debugOutputPath, devCommandFailed, devServerStartTimeout, downloadingText, extensionJsRunnerError, extensionLoadRecovered, extensionLoadStillRefused, extensionPreview, failedToDownloadOrExtractZIPFileError, getDirs, getDistPath, getProjectStructure, getSessionRunId, getSpecialFoldersDataForCompiler, getSpecialFoldersDataForProjectRoot, invalidRemoteZip, isChromiumBasedBrowser, isGeckoBasedBrowser, loadBrowserConfig, loadCommandConfig, loadCustomConfig, localZipNotFound, manifestInvalidJson, messages_ready, needsInstall, noCompanionExtensionsResolved, noEntrypointsDetected, normalizeBrowser, notAZipArchive, package_namespaceObject, packagingDistributionFiles, packagingSourceFiles, portInUse, projectInstallFallbackToNpm, projectInstallScriptsDisabled, resolveCompanionExtensionDirs, resolveCompanionExtensionsConfig, sanitize, spacerLine, toPosixPath, treeWithDistFilesBrowser, treeWithSourceAndDistFiles, treeWithSourceFiles, unpackagedSuccessfully, unpackagingExtension, writingTypeDefinitions, writingTypeDefinitionsError };
package/dist/494.mjs CHANGED
@@ -51,4 +51,4 @@ function actionsPath(projectPath, browser) {
51
51
  function buildSummaryPath(projectPath, browser) {
52
52
  return __rspack_external_node_path_c5b9b54f.join(browserArtifactsDir(projectPath, browser), 'build-summary.json');
53
53
  }
54
- export { actionsPath, browserArtifactsDir, buildSummaryPath, controlPortFilePath, controlTokenPath, ensureSessionArtifactsIgnoreFile, eventsPath, legacyControlPortFilePath, legacyControlTokenPath, logsPath, readyContractPath };
54
+ export { actionsPath, browserArtifactsDir, buildSummaryPath, controlPortFilePath, controlTokenPath, ensureSessionArtifactsIgnoreFile, eventsPath, legacyControlPortFilePath, legacyControlTokenPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir };
package/dist/839.mjs CHANGED
@@ -271,7 +271,7 @@ function attachLifecycleStream(compiler, stream) {
271
271
  }
272
272
  const MAX_SUMMARY_WARNINGS = 20;
273
273
  const build_summary_ANSI_PATTERN = /\u001b\[[0-9;]*m/g;
274
- function getBuildSummary(browser, info) {
274
+ function getBuildSummary(browser, info, outputPath) {
275
275
  const assets = info?.assets || [];
276
276
  const warnings = (info?.warnings || []).slice(0, MAX_SUMMARY_WARNINGS).map((warning)=>{
277
277
  const message = warning && 'object' == typeof warning ? String(warning.message ?? '') : String(warning ?? '');
@@ -279,6 +279,9 @@ function getBuildSummary(browser, info) {
279
279
  }).filter(Boolean);
280
280
  return {
281
281
  browser,
282
+ ...outputPath ? {
283
+ output_path: outputPath
284
+ } : {},
282
285
  total_assets: assets.length,
283
286
  total_bytes: assets.reduce((n, a)=>n + (a.size || 0), 0),
284
287
  largest_asset_bytes: assets.reduce((m, a)=>Math.max(m, a.size || 0), 0),
@@ -1022,6 +1025,7 @@ async function extensionBuild(pathOrRemoteUrl, buildOptions) {
1022
1025
  const compiler = rspack(compilerConfig);
1023
1026
  let summary = {
1024
1027
  browser,
1028
+ output_path: distPath,
1025
1029
  total_assets: 0,
1026
1030
  total_bytes: 0,
1027
1031
  largest_asset_bytes: 0,
@@ -1049,7 +1053,7 @@ async function extensionBuild(pathOrRemoteUrl, buildOptions) {
1049
1053
  warnings: true,
1050
1054
  errors: true
1051
1055
  });
1052
- summary = getBuildSummary(browser, info);
1056
+ summary = getBuildSummary(browser, info, distPath);
1053
1057
  try {
1054
1058
  const summaryFile = buildSummaryPath(packageJsonDir, browser);
1055
1059
  __rspack_external_node_fs_5ea92f0c.mkdirSync(__rspack_external_node_path_c5b9b54f.dirname(summaryFile), {
@@ -1069,13 +1073,22 @@ async function extensionBuild(pathOrRemoteUrl, buildOptions) {
1069
1073
  });
1070
1074
  if (('safari' === browser || 'webkit-based' === browser) && buildOptions?.safariPackager) {
1071
1075
  const safariConfig = await loadBrowserConfig(packageJsonDir, browser);
1072
- await buildOptions.safariPackager(distPath, 'full', {
1076
+ const safari = await buildOptions.safariPackager(distPath, 'full', {
1073
1077
  appName: buildOptions.appName ?? safariConfig.appName,
1074
1078
  bundleId: buildOptions.bundleId ?? safariConfig.bundleId,
1075
1079
  macOsOnly: buildOptions.macOsOnly ?? safariConfig.macOsOnly,
1076
1080
  forceRegenerate: buildOptions.forceRegenerate,
1077
1081
  safariBinary: buildOptions.safariBinary ?? safariConfig.safariBinary
1078
1082
  });
1083
+ if (safari) {
1084
+ summary = {
1085
+ ...summary,
1086
+ safari
1087
+ };
1088
+ try {
1089
+ __rspack_external_node_fs_5ea92f0c.writeFileSync(buildSummaryPath(packageJsonDir, browser), JSON.stringify(summary));
1090
+ } catch {}
1091
+ }
1079
1092
  }
1080
1093
  return summary;
1081
1094
  } catch (error) {
@@ -1,5 +1,8 @@
1
1
  export { BridgeConsumer, type ConsumerOptions, type ReadyContractInfo, readReadyContract } from './dev-server/control-bridge/consumer-client';
2
2
  export type { BridgeTarget, CommandOp, GapFrame, LogContext, LogEvent, LogLevel, ReadyFrame, ResultFrame } from './dev-server/control-bridge/contracts';
3
+ export { CONTROL_ENVELOPE_VERSION, CONTROL_WS_PATH, LOG_EVENT_VERSION } from './dev-server/control-bridge/contracts';
3
4
  export { controlPortFilePath, readPersistedControlPort } from './dev-server/control-bridge/control-port-store';
4
5
  export { BridgeController, type CommandInput, type ControllerOptions } from './dev-server/control-bridge/controller-client';
6
+ export { type LogQuery, matchesLogQuery, readLogEvents } from './dev-server/control-bridge/logs-query';
5
7
  export { controlTokenPath, readControlToken } from './dev-server/control-bridge/session-token';
8
+ export { actionsPath, browserArtifactsDir, buildSummaryPath, eventsPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir } from './lib/session-paths';
package/dist/bridge.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
2
2
  import { WebSocket } from "ws";
3
- import { readyContractPath } from "./494.mjs";
3
+ import { readyContractPath, logsPath } from "./494.mjs";
4
4
  import { CONTROL_WS_PATH } from "./887.mjs";
5
5
  import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
6
6
  function readReadyContract(projectPath, browser = 'chrome') {
@@ -232,6 +232,82 @@ class BridgeController {
232
232
  this.pending.clear();
233
233
  }
234
234
  }
235
- export { controlPortFilePath, controlTokenPath } from "./494.mjs";
236
- export { readControlToken, readPersistedControlPort } from "./887.mjs";
237
- export { BridgeConsumer, BridgeController, readReadyContract };
235
+ const LOG_LEVEL_ORDER = [
236
+ 'error',
237
+ 'warn',
238
+ 'info',
239
+ 'debug',
240
+ 'trace'
241
+ ];
242
+ function logLevelRank(level) {
243
+ const normalized = 'log' === level ? 'info' : level;
244
+ const index = LOG_LEVEL_ORDER.indexOf(normalized);
245
+ return -1 === index ? LOG_LEVEL_ORDER.length : index;
246
+ }
247
+ function toContextSet(context) {
248
+ if (null == context) return null;
249
+ const list = Array.isArray(context) ? context : String(context).split(',');
250
+ const names = list.map((name)=>name.trim()).filter(Boolean);
251
+ if (0 === names.length) return null;
252
+ if (1 === names.length && 'all' === names[0].toLowerCase()) return null;
253
+ return new Set(names);
254
+ }
255
+ function makeUrlMatcher(pattern) {
256
+ const escaped = pattern.includes('*') ? pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*') : null;
257
+ const expression = null == escaped ? null : new RegExp(escaped);
258
+ return (event)=>{
259
+ const candidates = [
260
+ event.url,
261
+ event.hostname
262
+ ].filter((value)=>'string' == typeof value);
263
+ if (0 === candidates.length) return false;
264
+ return candidates.some((candidate)=>expression ? expression.test(candidate) : candidate.includes(pattern));
265
+ };
266
+ }
267
+ function toFiniteNumber(value) {
268
+ if (null == value || '' === value) return null;
269
+ const parsed = 'number' == typeof value ? value : Number(value);
270
+ return Number.isFinite(parsed) ? parsed : null;
271
+ }
272
+ function matchesLogQuery(event, query) {
273
+ if (!event || 'object' != typeof event) return false;
274
+ if ('header' === event.type) return false;
275
+ if (query.signalsOnly && 'dx.signal' !== event.eventType) return false;
276
+ const contexts = toContextSet(query.context);
277
+ if (contexts && !contexts.has(String(event.context))) return false;
278
+ const minLevel = String(query.level ?? 'all').toLowerCase();
279
+ if ('all' !== minLevel && 'off' !== minLevel) {
280
+ if (logLevelRank(String(event.level || '')) > logLevelRank(minLevel)) return false;
281
+ }
282
+ const since = toFiniteNumber(query.since);
283
+ if (null != since && 'number' == typeof event.seq && event.seq <= since) return false;
284
+ if (query.url && !makeUrlMatcher(query.url)(event)) return false;
285
+ const tabId = toFiniteNumber(query.tab);
286
+ if (null != tabId && event.tabId !== tabId) return false;
287
+ return true;
288
+ }
289
+ function readLogEvents(projectPath, browser = 'chrome', query = {}) {
290
+ let raw;
291
+ try {
292
+ raw = __rspack_external_node_fs_5ea92f0c.readFileSync(logsPath(projectPath, browser), 'utf-8');
293
+ } catch {
294
+ return [];
295
+ }
296
+ const events = [];
297
+ for (const line of raw.split('\n')){
298
+ if (!line) continue;
299
+ let event;
300
+ try {
301
+ event = JSON.parse(line);
302
+ } catch {
303
+ continue;
304
+ }
305
+ if (matchesLogQuery(event, query)) events.push(event);
306
+ }
307
+ return events;
308
+ }
309
+ var bridge_entry_CONTROL_ENVELOPE_VERSION = 1;
310
+ var bridge_entry_LOG_EVENT_VERSION = 1;
311
+ export { CONTROL_WS_PATH, readControlToken, readPersistedControlPort } from "./887.mjs";
312
+ export { actionsPath, browserArtifactsDir, buildSummaryPath, controlPortFilePath, controlTokenPath, eventsPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir } from "./494.mjs";
313
+ export { BridgeConsumer, BridgeController, bridge_entry_CONTROL_ENVELOPE_VERSION as CONTROL_ENVELOPE_VERSION, bridge_entry_LOG_EVENT_VERSION as LOG_EVENT_VERSION, matchesLogQuery, readLogEvents, readReadyContract };
@@ -0,0 +1,37 @@
1
+ /** Increasing verbosity; a level selects itself plus everything more severe. */
2
+ export declare const LOG_LEVEL_ORDER: readonly ['error', 'warn', 'info', 'debug', 'trace'];
3
+ export type LogLevelFilter = (typeof LOG_LEVEL_ORDER)[number] | 'all' | 'off' | (string & {});
4
+ export interface LogQuery {
5
+ /** One context, a comma-separated list, an array, or 'all'. */
6
+ context?: string | string[];
7
+ /** Minimum severity. 'all' and 'off' select every level. */
8
+ level?: LogLevelFilter;
9
+ /** Only structured dx.signal diagnostics. */
10
+ signalsOnly?: boolean;
11
+ /** Only events whose seq is strictly greater than this. */
12
+ since?: number | string;
13
+ /** Glob (`*` = any run of chars) or plain substring over url then hostname. */
14
+ url?: string;
15
+ /** Only events carrying this tab id. */
16
+ tab?: number | string;
17
+ }
18
+ /** A bridge log line as read off disk: dynamic, so the probed fields only. */
19
+ export interface LogEventLike {
20
+ type?: unknown;
21
+ eventType?: unknown;
22
+ context?: unknown;
23
+ level?: unknown;
24
+ seq?: unknown;
25
+ url?: unknown;
26
+ hostname?: unknown;
27
+ tabId?: unknown;
28
+ }
29
+ export declare function logLevelRank(level: string): number;
30
+ /** True when the event passes every clause of the query. */
31
+ export declare function matchesLogQuery(event: LogEventLike, query: LogQuery): boolean;
32
+ /**
33
+ * One-shot read of a session's logs.ndjson. Returns an empty array when the
34
+ * session has never written one: an absent file is "nothing logged yet", and
35
+ * making that a throw would force every caller to guard it.
36
+ */
37
+ export declare function readLogEvents(projectPath: string, browser?: string, query?: LogQuery): LogEventLike[];