From 7ff3f2dbf922d233bd8c86c6609f53185cf9f496 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 7 Jul 2026 11:55:57 -0700 Subject: [PATCH] refactor(deadcode): localize UI and script symbols (#101858) --- scripts/build-diffs-viewer-runtime.mjs | 2 +- scripts/changed-lanes.mjs | 4 ++-- scripts/check-changed.mjs | 6 +++--- scripts/check-deadcode-unused-files.mjs | 2 +- scripts/check-dependency-pins.mjs | 2 +- scripts/check-dynamic-import-warts.mjs | 2 +- .../check-extension-package-tsc-boundary.mjs | 2 +- .../check-extension-plugin-sdk-boundary.mjs | 4 ++-- .../check-extension-wildcard-reexports.mjs | 2 +- scripts/check-ingress-agent-owner-context.mjs | 2 +- scripts/check-kysely-guardrails.mjs | 4 ++-- scripts/check-no-conflict-markers.mjs | 2 +- scripts/check-no-raw-channel-fetch.mjs | 2 +- scripts/check-no-register-http-handler.mjs | 2 +- ...check-plugin-extension-import-boundary.mjs | 2 +- .../check-plugin-sdk-wildcard-reexports.mjs | 2 +- scripts/check-protocol-event-coverage.mjs | 2 +- scripts/check-runtime-sidecar-loaders.mjs | 2 +- scripts/check-session-accessor-boundary.mjs | 2 +- .../check-web-search-provider-boundaries.mjs | 2 +- scripts/check-webhook-auth-body-order.mjs | 2 +- scripts/check.mjs | 2 +- scripts/close-duplicate-prs-after-merge.mjs | 2 +- scripts/dependency-changes-report.mjs | 2 +- scripts/e2e/kitchen-sink-rpc-walk.mjs | 8 ++++---- scripts/e2e/lib/config-reload/log-scanner.mjs | 2 +- scripts/e2e/lib/gateway-network/client.mjs | 4 ++-- scripts/e2e/parallels/smoke-common.ts | 20 +++++++++---------- scripts/e2e/telegram-user-crabbox-proof.ts | 6 +++--- scripts/format-docs.mjs | 2 +- scripts/generate-base-config-schema.ts | 2 +- ...enerate-bundled-channel-config-metadata.ts | 4 ++-- .../generate-dependency-release-evidence.mjs | 2 +- scripts/generate-prompt-snapshots.ts | 2 +- scripts/mobile-release-ref.ts | 4 ++-- scripts/native-app-i18n.ts | 2 +- scripts/openclaw-npm-postpublish-verify.ts | 2 +- scripts/plugin-clawhub-release-plan.ts | 2 +- scripts/plugin-npm-release-check.ts | 2 +- scripts/plugin-npm-release-plan.ts | 2 +- scripts/plugin-sdk-surface-report.mjs | 6 +++--- scripts/pre-commit/pnpm-audit-prod.mjs | 2 +- scripts/qa/ux-matrix-evidence-producer.ts | 2 +- .../resolve-upgrade-survivor-baselines.mjs | 6 +++--- scripts/run-oxlint-shards.mjs | 2 +- scripts/run-vitest.mjs | 4 ++-- scripts/runtime-postbuild.mjs | 10 +++++----- scripts/sync-codex-model-prompt-fixture.ts | 2 +- scripts/test-docker-all.mjs | 2 +- scripts/test-group-report.mjs | 2 +- scripts/test-live-shard.mjs | 2 +- scripts/test-live.mjs | 2 +- scripts/transitive-manifest-risk-report.mjs | 2 +- scripts/tsdown-build.mjs | 2 +- scripts/ui.js | 2 +- .../verify-plugin-npm-published-runtime.mjs | 2 +- scripts/verify.mjs | 2 +- scripts/write-cli-startup-metadata.ts | 2 +- scripts/write-package-dist-inventory.ts | 2 +- ui/src/app/app-host.ts | 2 +- ui/src/components/app-sidebar.ts | 2 +- ui/src/components/app-topbar.ts | 2 +- ui/src/components/connection-banner.ts | 2 +- ui/src/components/dashboard-header.ts | 2 +- ui/src/components/exec-approval.ts | 2 +- ui/src/components/gateway-url-confirmation.ts | 2 +- ui/src/components/login-gate.ts | 4 ++-- ui/src/components/theme-mode-toggle.ts | 2 +- ui/src/components/tooltip.ts | 4 ++-- ui/src/components/update-banner.ts | 2 +- ui/src/pages/chat/chat-pane.ts | 2 +- ui/src/pages/chat/components/chat-sidebar.ts | 2 +- 72 files changed, 105 insertions(+), 105 deletions(-) diff --git a/scripts/build-diffs-viewer-runtime.mjs b/scripts/build-diffs-viewer-runtime.mjs index 720d50e498e0..8597ddd65004 100644 --- a/scripts/build-diffs-viewer-runtime.mjs +++ b/scripts/build-diffs-viewer-runtime.mjs @@ -64,7 +64,7 @@ export function createPierreDiffsSideEffectImportPlugin() { /** * Builds one configured diffs viewer runtime target. */ -export async function buildDiffsViewerRuntime(targetName) { +async function buildDiffsViewerRuntime(targetName) { const target = targets[targetName]; if (!target) { throw new Error( diff --git a/scripts/changed-lanes.mjs b/scripts/changed-lanes.mjs index 3d978673865b..a891f4b3f372 100644 --- a/scripts/changed-lanes.mjs +++ b/scripts/changed-lanes.mjs @@ -357,7 +357,7 @@ export function listStagedChangedPaths(cwd = process.cwd()) { /** * Classifies package.json script-only changes from git content. */ -export function classifyPackageJsonChangeFromGit(params) { +function classifyPackageJsonChangeFromGit(params) { try { const { before, after } = readPackageJsonBeforeAfter(params); if (isLiveDockerPackageScriptOnlyChange(before, after)) { @@ -482,7 +482,7 @@ function stableJson(value) { /** * Writes changed-lane booleans to the GitHub Actions output file. */ -export function writeChangedLaneGitHubOutput(result, outputPath = process.env.GITHUB_OUTPUT) { +function writeChangedLaneGitHubOutput(result, outputPath = process.env.GITHUB_OUTPUT) { if (!outputPath) { throw new Error("GITHUB_OUTPUT is required"); } diff --git a/scripts/check-changed.mjs b/scripts/check-changed.mjs index d7069aca5366..6c576be372d6 100644 --- a/scripts/check-changed.mjs +++ b/scripts/check-changed.mjs @@ -120,7 +120,7 @@ function executableExistsOnPath(command, env = process.env) { return false; } -export function shouldSkipAppLintForMissingSwiftlint(options = {}) { +function shouldSkipAppLintForMissingSwiftlint(options = {}) { const env = options.env ?? process.env; const platform = options.platform ?? process.platform; const swiftlintAvailable = options.swiftlintAvailable ?? executableExistsOnPath("swiftlint", env); @@ -244,7 +244,7 @@ export function createShrinkwrapGuardCommand(paths) { }; } -export async function runChangedCheckViaCrabbox(argv = [], env = process.env) { +async function runChangedCheckViaCrabbox(argv = [], env = process.env) { console.error("[check:changed] delegating to Blacksmith Testbox via `pnpm crabbox:run`."); return await runManagedCommand({ bin: "pnpm", @@ -567,7 +567,7 @@ function createTargetedOxlintCommand({ }; } -export async function runChangedCheck(result, options = {}) { +async function runChangedCheck(result, options = {}) { const baseEnv = resolveLocalHeavyCheckEnv(options.env ?? process.env); const childEnv = createChangedCheckChildEnv(baseEnv); const plan = createChangedCheckPlan(result, { diff --git a/scripts/check-deadcode-unused-files.mjs b/scripts/check-deadcode-unused-files.mjs index b55755130a38..bff89d4969a9 100644 --- a/scripts/check-deadcode-unused-files.mjs +++ b/scripts/check-deadcode-unused-files.mjs @@ -114,7 +114,7 @@ export function compareUnusedFilesToAllowlist( /** * Formats unused-file allowlist drift for CLI output. */ -export function formatUnusedFileComparison(comparison) { +function formatUnusedFileComparison(comparison) { const lines = []; if (!comparison.allowlistIsSorted) { lines.push("deadcode unused-file allowlist is not sorted."); diff --git a/scripts/check-dependency-pins.mjs b/scripts/check-dependency-pins.mjs index 3bcc278d79f8..738418066d43 100644 --- a/scripts/check-dependency-pins.mjs +++ b/scripts/check-dependency-pins.mjs @@ -117,7 +117,7 @@ export function collectDependencyPinViolations(cwd = process.cwd()) { /** * Builds the full dependency pin audit payload. */ -export function collectDependencyPinAudit(cwd = process.cwd()) { +function collectDependencyPinAudit(cwd = process.cwd()) { const packageJsonFiles = listTrackedPackageJsonFiles(cwd); let packageSpecCount = 0; for (const relativePath of packageJsonFiles) { diff --git a/scripts/check-dynamic-import-warts.mjs b/scripts/check-dynamic-import-warts.mjs index 0a9badfbd8bd..bc42edfd6dce 100644 --- a/scripts/check-dynamic-import-warts.mjs +++ b/scripts/check-dynamic-import-warts.mjs @@ -178,7 +178,7 @@ export function findDynamicImportAdvisories(content, fileName = "source.ts") { /** * Collects dynamic import advisories across configured source roots. */ -export async function collectDynamicImportAdvisories(options = {}) { +async function collectDynamicImportAdvisories(options = {}) { const roots = options.roots ?? defaultRoots; const files = await collectTypeScriptFilesFromRoots(roots, { extraTestSuffixes: [".suite.ts"], diff --git a/scripts/check-extension-package-tsc-boundary.mjs b/scripts/check-extension-package-tsc-boundary.mjs index e2b002d34ae0..d624b7c47e9d 100644 --- a/scripts/check-extension-package-tsc-boundary.mjs +++ b/scripts/check-extension-package-tsc-boundary.mjs @@ -674,7 +674,7 @@ export function resolveCanaryArtifactPaths(extensionId, rootDir = repoRoot) { /** * Removes canary artifacts for one extension. */ -export function cleanupCanaryArtifacts(extensionId, rootDir = repoRoot) { +function cleanupCanaryArtifacts(extensionId, rootDir = repoRoot) { const { canaryPath, tsconfigPath } = resolveCanaryArtifactPaths(extensionId, rootDir); rmSync(canaryPath, { force: true }); rmSync(tsconfigPath, { force: true }); diff --git a/scripts/check-extension-plugin-sdk-boundary.mjs b/scripts/check-extension-plugin-sdk-boundary.mjs index f6ee00a944f7..c4324b246de3 100644 --- a/scripts/check-extension-plugin-sdk-boundary.mjs +++ b/scripts/check-extension-plugin-sdk-boundary.mjs @@ -229,7 +229,7 @@ function collectEntriesByModeFromModuleReferences(filePath, references) { /** * Collects the current extension plugin SDK boundary inventory. */ -export async function collectExtensionPluginSdkBoundaryInventory(mode) { +async function collectExtensionPluginSdkBoundaryInventory(mode) { if (!MODES.has(mode)) { throw new Error(`Unknown mode: ${mode}`); } @@ -307,7 +307,7 @@ function formatInventoryHuman(mode, inventory) { /** * Runs the boundary inventory check with CLI-style inputs and outputs. */ -export async function runExtensionPluginSdkBoundaryCheck(argv, io) { +async function runExtensionPluginSdkBoundaryCheck(argv, io) { const args = argv ?? process.argv.slice(2); const streams = io ?? { stdout: process.stdout, stderr: process.stderr }; const json = args.includes("--json"); diff --git a/scripts/check-extension-wildcard-reexports.mjs b/scripts/check-extension-wildcard-reexports.mjs index c0965f95eb31..3b9bbebe5000 100644 --- a/scripts/check-extension-wildcard-reexports.mjs +++ b/scripts/check-extension-wildcard-reexports.mjs @@ -52,7 +52,7 @@ export function findLocalWildcardReexports(source) { /** * Collects guarded extension API/runtime barrels that use wildcard re-exports. */ -export async function collectExtensionWildcardReexports(rootDir = repoRoot) { +async function collectExtensionWildcardReexports(rootDir = repoRoot) { const files = await listGuardedFiles(rootDir); const violations = []; for (const filePath of files) { diff --git a/scripts/check-ingress-agent-owner-context.mjs b/scripts/check-ingress-agent-owner-context.mjs index bd23b8451844..adccc441907f 100644 --- a/scripts/check-ingress-agent-owner-context.mjs +++ b/scripts/check-ingress-agent-owner-context.mjs @@ -23,7 +23,7 @@ const enforcedFiles = new Set([ /** * Finds legacy `agentCommand(...)` call lines in ingress-owned source. */ -export function findLegacyAgentCommandCallLines(content, fileName = "source.ts") { +function findLegacyAgentCommandCallLines(content, fileName = "source.ts") { const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true); return collectCallExpressionLines(ts, sourceFile, (node) => { const callee = unwrapExpression(node.expression); diff --git a/scripts/check-kysely-guardrails.mjs b/scripts/check-kysely-guardrails.mjs index 636d1cb95f18..b040f8ff154f 100644 --- a/scripts/check-kysely-guardrails.mjs +++ b/scripts/check-kysely-guardrails.mjs @@ -228,7 +228,7 @@ function isPersistedStringCastType(typeText) { /** * Collects Kysely/raw SQLite violations from one source file. */ -export function collectKyselyGuardrailViolations(content, relativePath) { +function collectKyselyGuardrailViolations(content, relativePath) { const sourceFile = ts.createSourceFile(relativePath, content, ts.ScriptTarget.Latest, true); const imports = collectImports(sourceFile); const violations = []; @@ -352,7 +352,7 @@ export function collectKyselyGuardrailViolations(content, relativePath) { /** * Collects Kysely guardrail violations across configured source roots. */ -export async function collectKyselyGuardrails() { +async function collectKyselyGuardrails() { const files = await collectTypeScriptFilesFromRoots(sourceRoots, { includeTests: true }); const violations = []; for (const filePath of files) { diff --git a/scripts/check-no-conflict-markers.mjs b/scripts/check-no-conflict-markers.mjs index e82cbd33faff..807cc6cd6eb8 100644 --- a/scripts/check-no-conflict-markers.mjs +++ b/scripts/check-no-conflict-markers.mjs @@ -77,7 +77,7 @@ export function findConflictMarkersInFiles(filePaths, readFile = fs.readFileSync /** * Uses git grep to list tracked files that may contain conflict markers. */ -export function listTrackedFilesWithConflictMarkerCandidates(cwd = process.cwd(), run = spawnSync) { +function listTrackedFilesWithConflictMarkerCandidates(cwd = process.cwd(), run = spawnSync) { const result = run( "git", ["grep", "-l", "-z", "-I", "-E", CONFLICT_MARKER_GREP_PATTERN, "--", "."], diff --git a/scripts/check-no-raw-channel-fetch.mjs b/scripts/check-no-raw-channel-fetch.mjs index 53b3c28ec353..c4e2549e9500 100644 --- a/scripts/check-no-raw-channel-fetch.mjs +++ b/scripts/check-no-raw-channel-fetch.mjs @@ -83,7 +83,7 @@ function isRawFetchCall(expression) { /** * Finds raw `fetch(...)` and `globalThis.fetch(...)` call lines. */ -export function findRawFetchCallLines(content, fileName = "source.ts") { +function findRawFetchCallLines(content, fileName = "source.ts") { const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true); return collectCallExpressionLines(ts, sourceFile, (node) => isRawFetchCall(node.expression) ? node.expression : null, diff --git a/scripts/check-no-register-http-handler.mjs b/scripts/check-no-register-http-handler.mjs index 9b602eb5e935..bca5a61c4744 100644 --- a/scripts/check-no-register-http-handler.mjs +++ b/scripts/check-no-register-http-handler.mjs @@ -19,7 +19,7 @@ function isDeprecatedRegisterHttpHandlerCall(expression) { /** * Finds deprecated `registerHttpHandler(...)` call lines. */ -export function findDeprecatedRegisterHttpHandlerLines(content, fileName = "source.ts") { +function findDeprecatedRegisterHttpHandlerLines(content, fileName = "source.ts") { const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true); return collectCallExpressionLines(ts, sourceFile, (node) => isDeprecatedRegisterHttpHandlerCall(node.expression) ? node.expression : null, diff --git a/scripts/check-plugin-extension-import-boundary.mjs b/scripts/check-plugin-extension-import-boundary.mjs index a80912412fd2..fa0200e0fbb4 100644 --- a/scripts/check-plugin-extension-import-boundary.mjs +++ b/scripts/check-plugin-extension-import-boundary.mjs @@ -212,7 +212,7 @@ function formatEntry(entry) { /** * Runs the plugin-extension import boundary baseline check. */ -export async function runPluginExtensionImportBoundaryCheck(argv, io) { +async function runPluginExtensionImportBoundaryCheck(argv, io) { return await runBaselineInventoryCheck({ argv: argv ?? process.argv.slice(2), io, diff --git a/scripts/check-plugin-sdk-wildcard-reexports.mjs b/scripts/check-plugin-sdk-wildcard-reexports.mjs index 4ee967317cef..70c520bde4ee 100644 --- a/scripts/check-plugin-sdk-wildcard-reexports.mjs +++ b/scripts/check-plugin-sdk-wildcard-reexports.mjs @@ -48,7 +48,7 @@ export function findPluginSdkWildcardReexports(source) { /** * Collects extension API barrels that wildcard re-export plugin SDK subpaths. */ -export async function collectPluginSdkWildcardReexports(rootDir = repoRoot) { +async function collectPluginSdkWildcardReexports(rootDir = repoRoot) { const files = await listExtensionApiFiles(path.join(rootDir, "extensions")); const violations = []; for (const filePath of files) { diff --git a/scripts/check-protocol-event-coverage.mjs b/scripts/check-protocol-event-coverage.mjs index 892d81b2eaa6..fc0d4d5d4a5d 100644 --- a/scripts/check-protocol-event-coverage.mjs +++ b/scripts/check-protocol-event-coverage.mjs @@ -420,7 +420,7 @@ function collectSwiftStaticStringConstants(sources) { * Runs the full coverage check against a repo checkout and returns error * strings plus a summary for logging. */ -export function collectProtocolEventCoverageErrors(params = {}) { +function collectProtocolEventCoverageErrors(params = {}) { const rootDir = params.rootDir ?? process.cwd(); const fsImpl = params.fs ?? fs; diff --git a/scripts/check-runtime-sidecar-loaders.mjs b/scripts/check-runtime-sidecar-loaders.mjs index 20e0799893fb..5e8bcd5d9cb0 100644 --- a/scripts/check-runtime-sidecar-loaders.mjs +++ b/scripts/check-runtime-sidecar-loaders.mjs @@ -230,7 +230,7 @@ export function findRuntimeSidecarLoaderViolations(content, importerPath, explic /** * Collects runtime sidecar loader violations across configured roots. */ -export async function collectRuntimeSidecarLoaderViolations(params) { +async function collectRuntimeSidecarLoaderViolations(params) { const files = await collectTypeScriptFilesFromRoots(params.sourceRoots, { extraTestSuffixes: [".test-support.ts", ".test-helpers.ts"], }); diff --git a/scripts/check-session-accessor-boundary.mjs b/scripts/check-session-accessor-boundary.mjs index 2086800e6328..db915313b925 100644 --- a/scripts/check-session-accessor-boundary.mjs +++ b/scripts/check-session-accessor-boundary.mjs @@ -734,7 +734,7 @@ function sortRecordByKey(record) { } /** Counts legacy call sites per unmigrated file for every debt concern. */ -export async function collectSessionAccessorDebtCounts(repoRoot) { +async function collectSessionAccessorDebtCounts(repoRoot) { const counts = {}; for (const concern of sessionAccessorDebtConcerns) { const violations = await collectFileViolations({ diff --git a/scripts/check-web-search-provider-boundaries.mjs b/scripts/check-web-search-provider-boundaries.mjs index 4dca8b1fb663..d7de4fa51e02 100644 --- a/scripts/check-web-search-provider-boundaries.mjs +++ b/scripts/check-web-search-provider-boundaries.mjs @@ -232,7 +232,7 @@ function formatEntry(entry) { /** * Runs the web-search provider boundary baseline check. */ -export async function runWebSearchProviderBoundaryCheck(argv, io) { +async function runWebSearchProviderBoundaryCheck(argv, io) { return await runBaselineInventoryCheck({ argv: argv ?? process.argv.slice(2), io, diff --git a/scripts/check-webhook-auth-body-order.mjs b/scripts/check-webhook-auth-body-order.mjs index a4aab88b8147..fb7dc09a138f 100644 --- a/scripts/check-webhook-auth-body-order.mjs +++ b/scripts/check-webhook-auth-body-order.mjs @@ -33,7 +33,7 @@ function getCalleeName(expression) { /** * Finds request body reads that occur before webhook auth validation. */ -export function findBlockedWebhookBodyReadLines(content, fileName = "source.ts") { +function findBlockedWebhookBodyReadLines(content, fileName = "source.ts") { const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true); const lines = []; const visit = (node) => { diff --git a/scripts/check.mjs b/scripts/check.mjs index a0b5ecc60c88..d4bea9bec9b0 100644 --- a/scripts/check.mjs +++ b/scripts/check.mjs @@ -23,7 +23,7 @@ export function usage() { /** * Parses aggregate check runner arguments. */ -export function parseCheckArgs(argv) { +function parseCheckArgs(argv) { const args = { help: false, includeArchitecture: false, diff --git a/scripts/close-duplicate-prs-after-merge.mjs b/scripts/close-duplicate-prs-after-merge.mjs index d4a8ac34aa51..b49c858921cf 100644 --- a/scripts/close-duplicate-prs-after-merge.mjs +++ b/scripts/close-duplicate-prs-after-merge.mjs @@ -149,7 +149,7 @@ export function parseUnifiedDiffRanges(diffText) { /** * Reports whether two PR diffs touch overlapping hunks. */ -export function hasOverlappingHunks(leftRanges, rightRanges) { +function hasOverlappingHunks(leftRanges, rightRanges) { for (const [path, left] of leftRanges) { const right = rightRanges.get(path) ?? []; for (const leftRange of left) { diff --git a/scripts/dependency-changes-report.mjs b/scripts/dependency-changes-report.mjs index 0634461f9a09..3f7cbb817351 100644 --- a/scripts/dependency-changes-report.mjs +++ b/scripts/dependency-changes-report.mjs @@ -314,7 +314,7 @@ async function writeArtifact(filePath, content) { /** * Generates and writes dependency change report artifacts. */ -export async function runDependencyChangesReport(options) { +async function runDependencyChangesReport(options) { const headLockfileText = await readFile(path.join(options.rootDir, options.headLockfile), "utf8"); const baseLockfileText = options.baseRef ? readGitFile(options.baseRef, "pnpm-lock.yaml", options.rootDir) diff --git a/scripts/e2e/kitchen-sink-rpc-walk.mjs b/scripts/e2e/kitchen-sink-rpc-walk.mjs index 7f2525ac9e66..bc3dcf3f6525 100644 --- a/scripts/e2e/kitchen-sink-rpc-walk.mjs +++ b/scripts/e2e/kitchen-sink-rpc-walk.mjs @@ -150,7 +150,7 @@ export function readPositiveInt(raw, fallback, label = "value") { return parsed; } -export function clampKitchenSinkTimerTimeoutMs(value) { +function clampKitchenSinkTimerTimeoutMs(value) { if (!Number.isFinite(value)) { return 1; } @@ -212,7 +212,7 @@ export function resolveKitchenSinkRpcConfig(env = process.env) { }; } -export async function findAvailableLoopbackPort(options = {}) { +async function findAvailableLoopbackPort(options = {}) { const createServer = options.createServer ?? (() => net.createServer()); const server = createServer(); return await new Promise((resolve, reject) => { @@ -718,7 +718,7 @@ export function parseGatewayCliRequestFailure(error) { return payload?.ok === false ? createGatewayClientRequestError(payload.error) : null; } -export function createGatewayClientRequestError(requestError) { +function createGatewayClientRequestError(requestError) { if ( requestError?.type !== "gateway_request_error" || !isNonEmptyString(requestError.code) || @@ -1540,7 +1540,7 @@ export function extractPluginCommandNames(payload) { .toSorted((left, right) => left.localeCompare(right)); } -export function extractToolEntries(payload) { +function extractToolEntries(payload) { return (Array.isArray(payload?.groups) ? payload.groups : []).flatMap((group) => Array.isArray(group?.tools) ? group.tools : [], ); diff --git a/scripts/e2e/lib/config-reload/log-scanner.mjs b/scripts/e2e/lib/config-reload/log-scanner.mjs index 6a658ca63fff..1c9c59483aee 100644 --- a/scripts/e2e/lib/config-reload/log-scanner.mjs +++ b/scripts/e2e/lib/config-reload/log-scanner.mjs @@ -9,7 +9,7 @@ const DEFAULT_TAIL_LINE_LIMIT = 160; const RELOAD_NEEDLE = "config change detected; evaluating reload"; const RESTART_NEEDLE = "config change requires gateway restart"; -export function inspectConfigReloadLogLine(line) { +function inspectConfigReloadLogLine(line) { return { reload: line.includes(RELOAD_NEEDLE), restart: line.includes(RESTART_NEEDLE), diff --git a/scripts/e2e/lib/gateway-network/client.mjs b/scripts/e2e/lib/gateway-network/client.mjs index 5b3eb9329cd3..4342a3d056fa 100644 --- a/scripts/e2e/lib/gateway-network/client.mjs +++ b/scripts/e2e/lib/gateway-network/client.mjs @@ -20,7 +20,7 @@ function isRecord(value) { return value !== null && typeof value === "object" && !Array.isArray(value); } -export function hasGatewayHealthSummaryPayload(response) { +function hasGatewayHealthSummaryPayload(response) { if (!isRecord(response) || !isRecord(response.payload)) { return false; } @@ -43,7 +43,7 @@ export function responseError(method, response) { return new Error(`${method} failed: ${message}`); } -export function isRetryableStartupError(message) { +function isRetryableStartupError(message) { return ( message.includes("gateway starting") || message.includes("closed before frame") || diff --git a/scripts/e2e/parallels/smoke-common.ts b/scripts/e2e/parallels/smoke-common.ts index 3b4eec00f0dd..2a97ff3ce148 100644 --- a/scripts/e2e/parallels/smoke-common.ts +++ b/scripts/e2e/parallels/smoke-common.ts @@ -120,7 +120,7 @@ export abstract class SmokeRunController { @@ -130,7 +130,7 @@ export async function resolveSmokeHostConfig( }; } -export async function prepareSmokeRunHost( +async function prepareSmokeRunHost( options: SmokeHostOptions, defaultPort: number, latestVersion: string, @@ -150,7 +150,7 @@ export async function prepareSmokeRunHost( return [host.hostIp, host.hostPort]; } -export function logSmokeRunStart(input: { +function logSmokeRunStart(input: { latestVersion: string; runDir: string; snapshot: SnapshotInfo; @@ -165,7 +165,7 @@ export function logSmokeRunStart(input: { say(`Run logs: ${input.runDir}`); } -export async function startSmokeArtifactServer(input: { +async function startSmokeArtifactServer(input: { artifact: PackageArtifact; dir: string; hostIp: string; @@ -205,7 +205,7 @@ export async function packAndServeSmokeArtifact( return [artifact, server.server, server.hostPort]; } -export async function runRequestedSmokeLanes(input: { +async function runRequestedSmokeLanes(input: { mode: Mode; runFresh: () => Promise; runLane: (name: "fresh" | "upgrade", fn: () => Promise) => Promise; @@ -219,7 +219,7 @@ export async function runRequestedSmokeLanes(input: { } } -export async function runSmokeLaneWithStatus( +async function runSmokeLaneWithStatus( name: "fresh" | "upgrade", fn: () => Promise, statuses: Pick, @@ -227,7 +227,7 @@ export async function runSmokeLaneWithStatus( await runSmokeLane(name, fn, (lane, status) => setSmokeLaneStatus(statuses, lane, status)); } -export function setSmokeLaneStatus( +function setSmokeLaneStatus( statuses: Pick, name: SmokeLane, status: SmokeLaneStatus, @@ -239,7 +239,7 @@ export function setSmokeLaneStatus( } } -export async function finishSmokeRun(input: { +async function finishSmokeRun(input: { json: boolean; printSummary: (summaryPath: string) => void; status: Pick; @@ -255,7 +255,7 @@ export async function finishSmokeRun(input: { } } -export async function runSmokeLanesAndFinish( +async function runSmokeLanesAndFinish( mode: Mode, json: boolean, status: Pick, @@ -278,7 +278,7 @@ export async function runSmokeLanesAndFinish( }); } -export async function cleanupSmokeArtifacts(input: { +async function cleanupSmokeArtifacts(input: { keepServer: boolean; server: HostServer | null; tgzDir: string; diff --git a/scripts/e2e/telegram-user-crabbox-proof.ts b/scripts/e2e/telegram-user-crabbox-proof.ts index 2b150ec58677..eeb00ecf0d7b 100644 --- a/scripts/e2e/telegram-user-crabbox-proof.ts +++ b/scripts/e2e/telegram-user-crabbox-proof.ts @@ -577,12 +577,12 @@ function appendCommandText(current: string, chunk: Buffer): string { return current + chunk.toString("utf8"); } -export function appendCommandTextTail(current: string, chunk: Buffer, maxChars: number): string { +function appendCommandTextTail(current: string, chunk: Buffer, maxChars: number): string { const next = appendCommandText(current, chunk); return next.length > maxChars ? next.slice(-maxChars) : next; } -export function appendCommandStdout( +function appendCommandStdout( current: string, chunk: Buffer, maxChars = COMMAND_STDOUT_MAX_CHARS, @@ -594,7 +594,7 @@ export function appendCommandStdout( return { ok: true, value: next }; } -export function appendCommandStderrTail( +function appendCommandStderrTail( current: string, chunk: Buffer, maxChars = COMMAND_STDERR_TAIL_CHARS, diff --git a/scripts/format-docs.mjs b/scripts/format-docs.mjs index 4cad64c6c0a3..7b87cbbc3a45 100644 --- a/scripts/format-docs.mjs +++ b/scripts/format-docs.mjs @@ -183,7 +183,7 @@ export function runOxfmt(files, params = {}, deps = {}) { } } -export function repairFiles(root, files) { +function repairFiles(root, files) { const changed = []; for (const relativePath of files) { const absolutePath = path.join(root, relativePath); diff --git a/scripts/generate-base-config-schema.ts b/scripts/generate-base-config-schema.ts index 4f73967d0dd8..c4a81dba9310 100644 --- a/scripts/generate-base-config-schema.ts +++ b/scripts/generate-base-config-schema.ts @@ -3,7 +3,7 @@ import { pathToFileURL } from "node:url"; import { computeBaseConfigSchemaResponse } from "../src/config/schema-base.js"; -export function checkBaseConfigSchema(): void { +function checkBaseConfigSchema(): void { computeBaseConfigSchemaResponse({ generatedAt: "2026-05-05T00:00:00.000Z", }); diff --git a/scripts/generate-bundled-channel-config-metadata.ts b/scripts/generate-bundled-channel-config-metadata.ts index 693f168d377d..8466600ac26f 100644 --- a/scripts/generate-bundled-channel-config-metadata.ts +++ b/scripts/generate-bundled-channel-config-metadata.ts @@ -235,7 +235,7 @@ function resolveChannelUnsupportedSecretRefSurfacePatterns( } } -export async function collectBundledChannelConfigMetadata(params?: { repoRoot?: string }) { +async function collectBundledChannelConfigMetadata(params?: { repoRoot?: string }) { const repoRoot = path.resolve(params?.repoRoot ?? process.cwd()); const sources = collectBundledPluginSources({ repoRoot, requirePackageJson: true }); const entries: BundledChannelConfigMetadata[] = []; @@ -289,7 +289,7 @@ export async function collectBundledChannelConfigMetadata(params?: { repoRoot?: return entries.toSorted((left, right) => left.channelId.localeCompare(right.channelId)); } -export async function writeBundledChannelConfigMetadataModule(params?: { +async function writeBundledChannelConfigMetadataModule(params?: { repoRoot?: string; outputPath?: string; check?: boolean; diff --git a/scripts/generate-dependency-release-evidence.mjs b/scripts/generate-dependency-release-evidence.mjs index cc4b92543988..e6e867d1486b 100644 --- a/scripts/generate-dependency-release-evidence.mjs +++ b/scripts/generate-dependency-release-evidence.mjs @@ -292,7 +292,7 @@ function runEvidenceReports({ rootDir, outputDir, baseRef, execFileSyncImpl }) { /** * Generates dependency evidence reports, manifest, and summaries for a release. */ -export async function generateDependencyReleaseEvidence({ +async function generateDependencyReleaseEvidence({ rootDir = process.cwd(), outputDir, releaseRef, diff --git a/scripts/generate-prompt-snapshots.ts b/scripts/generate-prompt-snapshots.ts index 736961207ce0..33fd3908a579 100644 --- a/scripts/generate-prompt-snapshots.ts +++ b/scripts/generate-prompt-snapshots.ts @@ -116,7 +116,7 @@ async function checkSnapshots() { console.log(`Prompt snapshots are current (${files.length} files).`); } -export async function runPromptSnapshotGenerator(argv = process.argv.slice(2)) { +async function runPromptSnapshotGenerator(argv = process.argv.slice(2)) { const mode = argv.includes("--write") ? "write" : argv.includes("--check") ? "check" : undefined; if (!mode) { diff --git a/scripts/mobile-release-ref.ts b/scripts/mobile-release-ref.ts index 5dad82831db3..acee7c0191fe 100644 --- a/scripts/mobile-release-ref.ts +++ b/scripts/mobile-release-ref.ts @@ -218,11 +218,11 @@ function assertRootDir(rootDir: string): void { } } -export function resolveCommitSha(sha: string, rootDir: string, deps: GitDeps = {}): string { +function resolveCommitSha(sha: string, rootDir: string, deps: GitDeps = {}): string { return git(["rev-parse", "--verify", `${sha}^{commit}`], rootDir, deps).trim(); } -export function readRemoteRef( +function readRemoteRef( remote: string, ref: string, rootDir: string, diff --git a/scripts/native-app-i18n.ts b/scripts/native-app-i18n.ts index 5b59a62984c2..bafa9b1b1947 100644 --- a/scripts/native-app-i18n.ts +++ b/scripts/native-app-i18n.ts @@ -1000,7 +1000,7 @@ function render(entries: NativeI18nEntry[]): string { return `${JSON.stringify({ version: 1, entries }, null, 2)}\n`; } -export async function syncNativeI18n(options: { checkOnly: boolean; write: boolean }) { +async function syncNativeI18n(options: { checkOnly: boolean; write: boolean }) { const expected = render(await collectNativeI18nEntries()); let current = ""; try { diff --git a/scripts/openclaw-npm-postpublish-verify.ts b/scripts/openclaw-npm-postpublish-verify.ts index 26d33d381ce8..f1c5ccc18e76 100644 --- a/scripts/openclaw-npm-postpublish-verify.ts +++ b/scripts/openclaw-npm-postpublish-verify.ts @@ -644,7 +644,7 @@ export function collectInstalledPluginSdkZodArtifactErrors(packageRoot: string): return []; } -export function collectInstalledPluginSdkDeclarationErrors(packageRoot: string): string[] { +function collectInstalledPluginSdkDeclarationErrors(packageRoot: string): string[] { const pluginSdkDistRoot = join(packageRoot, "dist", "plugin-sdk"); const errors: string[] = []; const forbiddenPrivateWorkspaceSpecifiers = ["@openclaw/llm-core"]; diff --git a/scripts/plugin-clawhub-release-plan.ts b/scripts/plugin-clawhub-release-plan.ts index d62e163dfec6..16aef5013c41 100644 --- a/scripts/plugin-clawhub-release-plan.ts +++ b/scripts/plugin-clawhub-release-plan.ts @@ -7,7 +7,7 @@ import { parsePluginReleaseArgs, } from "./lib/plugin-clawhub-release.ts"; -export async function collectPluginReleasePlanForClawHub(argv: string[]) { +async function collectPluginReleasePlanForClawHub(argv: string[]) { const { selection, selectionMode, baseRef, headRef } = parsePluginReleaseArgs(argv); return await collectPluginClawHubReleasePlan({ selection, diff --git a/scripts/plugin-npm-release-check.ts b/scripts/plugin-npm-release-check.ts index b1445a6877bb..ef9cc39abf64 100644 --- a/scripts/plugin-npm-release-check.ts +++ b/scripts/plugin-npm-release-check.ts @@ -12,7 +12,7 @@ import { resolveSelectedPublishablePluginPackages, } from "./lib/plugin-npm-release.ts"; -export function runPluginNpmReleaseCheck(argv: string[]) { +function runPluginNpmReleaseCheck(argv: string[]) { const { selection, selectionMode, npmDistTag, baseRef, headRef } = parsePluginNpmReleaseArgs(argv); const changedExtensionIds = diff --git a/scripts/plugin-npm-release-plan.ts b/scripts/plugin-npm-release-plan.ts index b8c649c00653..6639c3c1cd21 100644 --- a/scripts/plugin-npm-release-plan.ts +++ b/scripts/plugin-npm-release-plan.ts @@ -4,7 +4,7 @@ import { pathToFileURL } from "node:url"; import { collectPluginReleasePlan, parsePluginNpmReleaseArgs } from "./lib/plugin-npm-release.ts"; -export function collectPluginNpmReleasePlan(argv: string[]) { +function collectPluginNpmReleasePlan(argv: string[]) { const { selection, selectionMode, npmDistTag, baseRef, headRef } = parsePluginNpmReleaseArgs(argv); return collectPluginReleasePlan({ diff --git a/scripts/plugin-sdk-surface-report.mjs b/scripts/plugin-sdk-surface-report.mjs index 29a5bf65b9de..5c9cf8621773 100644 --- a/scripts/plugin-sdk-surface-report.mjs +++ b/scripts/plugin-sdk-surface-report.mjs @@ -28,7 +28,7 @@ Options: `; } -export function parsePluginSdkSurfaceReportArgs(argv) { +function parsePluginSdkSurfaceReportArgs(argv) { const args = { check: false, help: false }; for (const arg of argv) { if (arg === "--check") { @@ -49,7 +49,7 @@ const deprecatedPublicEntrypointSet = new Set(deprecatedPublicPluginSdkEntrypoin const deprecatedBarrelEntrypointSet = new Set(deprecatedBarrelPluginSdkEntrypoints); const forbiddenPublicSubpaths = new Set(["test-utils"]); -export function readPluginSdkSurfaceBudgetEnv(name, fallback, env = process.env) { +function readPluginSdkSurfaceBudgetEnv(name, fallback, env = process.env) { const raw = env[name]; if (raw === undefined) { return fallback; @@ -65,7 +65,7 @@ export function readPluginSdkSurfaceBudgetEnv(name, fallback, env = process.env) return parsed; } -export function readPluginSdkEntrypointBudgetEnv(name, fallback, env = process.env) { +function readPluginSdkEntrypointBudgetEnv(name, fallback, env = process.env) { const raw = env[name]; if (raw === undefined) { return fallback; diff --git a/scripts/pre-commit/pnpm-audit-prod.mjs b/scripts/pre-commit/pnpm-audit-prod.mjs index 919627ad96c5..001676c0b648 100644 --- a/scripts/pre-commit/pnpm-audit-prod.mjs +++ b/scripts/pre-commit/pnpm-audit-prod.mjs @@ -41,7 +41,7 @@ const AUDIT_ADVISORY_VERSION_OVERRIDES = [ }, ]; -export function normalizeAuditLevel(level) { +function normalizeAuditLevel(level) { const normalized = String(level ?? "").toLowerCase(); if (normalized in SEVERITY_RANK) { return normalized; diff --git a/scripts/qa/ux-matrix-evidence-producer.ts b/scripts/qa/ux-matrix-evidence-producer.ts index 50dbbeb0f60d..42518436ff03 100644 --- a/scripts/qa/ux-matrix-evidence-producer.ts +++ b/scripts/qa/ux-matrix-evidence-producer.ts @@ -647,7 +647,7 @@ async function writeProducerMetadata(params: { ); } -export async function runUxMatrixEvidenceProducer(options: ProducerOptions) { +async function runUxMatrixEvidenceProducer(options: ProducerOptions) { await fs.mkdir(options.artifactBase, { recursive: true }); await writePreflight(options.artifactBase); diff --git a/scripts/resolve-upgrade-survivor-baselines.mjs b/scripts/resolve-upgrade-survivor-baselines.mjs index c53fc0749a0a..353d807601d2 100644 --- a/scripts/resolve-upgrade-survivor-baselines.mjs +++ b/scripts/resolve-upgrade-survivor-baselines.mjs @@ -109,7 +109,7 @@ function readStableReleases(file, publishedVersions) { /** * Expands the release-history token into recent stable plus pinned historical baselines. */ -export function resolveReleaseHistory(args) { +function resolveReleaseHistory(args) { const releasesJson = args.get("releases-json"); if (!releasesJson) { throw new Error("--releases-json is required when requested baselines include release-history"); @@ -136,7 +136,7 @@ export function resolveReleaseHistory(args) { /** * Resolves the last N stable release versions from release metadata. */ -export function resolveLastStable(args, count) { +function resolveLastStable(args, count) { const releasesJson = args.get("releases-json"); if (!releasesJson) { throw new Error("--releases-json is required when requested baselines include last-stable-*"); @@ -152,7 +152,7 @@ export function resolveLastStable(args, count) { /** * Resolves all stable release versions at or after the requested minimum. */ -export function resolveAllSince(args, minimumVersion) { +function resolveAllSince(args, minimumVersion) { const releasesJson = args.get("releases-json"); if (!releasesJson) { throw new Error("--releases-json is required when requested baselines include all-since-*"); diff --git a/scripts/run-oxlint-shards.mjs b/scripts/run-oxlint-shards.mjs index b6e5ec7f7972..2730bcf5286e 100644 --- a/scripts/run-oxlint-shards.mjs +++ b/scripts/run-oxlint-shards.mjs @@ -62,7 +62,7 @@ export function createOxlintShards({ /** * Splits core oxlint targets into smaller source/package/UI shards. */ -export function createCoreOxlintShards({ cwd = process.cwd(), readDir = fs.readdirSync } = {}) { +function createCoreOxlintShards({ cwd = process.cwd(), readDir = fs.readdirSync } = {}) { const sourceShards = listSourceRootTargetGroups({ cwd, readDir }).map((targets) => ({ name: targets.length === 1 ? `core:${targets[0].replaceAll("/", ":")}` : "core:src:root", args: ["--tsconfig", CORE_TS_CONFIG, ...targets], diff --git a/scripts/run-vitest.mjs b/scripts/run-vitest.mjs index aae33031af21..6a7015b65e09 100644 --- a/scripts/run-vitest.mjs +++ b/scripts/run-vitest.mjs @@ -423,7 +423,7 @@ export function resolveVitestSpawnParams(env = process.env, platform = process.p /** * Applies local Vitest scheduling and native worker budget env. */ -export function resolveVitestSpawnEnv(env = process.env) { +function resolveVitestSpawnEnv(env = process.env) { const baseEnv = resolveLocalVitestEnv(env); if (!shouldApplyNativeWorkerBudget(baseEnv)) { return baseEnv; @@ -892,7 +892,7 @@ export function installVitestNoOutputWatchdog(params) { /** * Forwards child output while optionally suppressing complete stderr lines. */ -export function forwardVitestOutput(stream, target, shouldSuppressLine = () => false) { +function forwardVitestOutput(stream, target, shouldSuppressLine = () => false) { if (!stream) { return; } diff --git a/scripts/runtime-postbuild.mjs b/scripts/runtime-postbuild.mjs index 3598cedd34bb..71e8398cbade 100644 --- a/scripts/runtime-postbuild.mjs +++ b/scripts/runtime-postbuild.mjs @@ -149,14 +149,14 @@ export const LEGACY_CLI_EXIT_COMPAT_CHUNKS = [ /** * Lists generated plugin SDK root-alias outputs. */ -export function listPluginSdkRootAliasOutputs() { +function listPluginSdkRootAliasOutputs() { return [PLUGIN_SDK_ROOT_ALIAS_OUTPUT]; } /** * Lists generated official channel catalog outputs. */ -export function listOfficialChannelCatalogOutputs() { +function listOfficialChannelCatalogOutputs() { return [OFFICIAL_CHANNEL_CATALOG_OUTPUT]; } @@ -232,7 +232,7 @@ function resolveStableRootRuntimeAliasCandidate(params) { /** * Lists stable aliases for hashed root runtime/contract chunks. */ -export function listStableRootRuntimeAliasOutputs(params = {}) { +function listStableRootRuntimeAliasOutputs(params = {}) { const rootDir = params.rootDir ?? ROOT; const distDir = path.join(rootDir, "dist"); const fsImpl = params.fs ?? fs; @@ -252,7 +252,7 @@ export function listStableRootRuntimeAliasOutputs(params = {}) { /** * Lists compatibility chunk outputs required for old CLI exit paths. */ -export function listLegacyCliExitCompatOutputs(params = {}) { +function listLegacyCliExitCompatOutputs(params = {}) { const chunks = params.chunks ?? LEGACY_CLI_EXIT_COMPAT_CHUNKS; return chunks .map(({ dest }) => dest.replace(/\\/g, "/")) @@ -262,7 +262,7 @@ export function listLegacyCliExitCompatOutputs(params = {}) { /** * Lists legacy hashed runtime aliases that may be needed during live upgrades. */ -export function listLegacyRootRuntimeCompatOutputs(params = {}) { +function listLegacyRootRuntimeCompatOutputs(params = {}) { const rootDir = params.rootDir ?? ROOT; const distDir = path.join(rootDir, "dist"); const fsImpl = params.fs ?? fs; diff --git a/scripts/sync-codex-model-prompt-fixture.ts b/scripts/sync-codex-model-prompt-fixture.ts index b0c36a395cb9..f0d84688d15d 100644 --- a/scripts/sync-codex-model-prompt-fixture.ts +++ b/scripts/sync-codex-model-prompt-fixture.ts @@ -109,7 +109,7 @@ export function renderCodexModelInstructions(params: { throw new Error(`Codex model ${params.model.slug} has no renderable instructions.`); } -export async function createCodexModelPromptFixture(params: { +async function createCodexModelPromptFixture(params: { catalogPath: string; catalogLabel?: string; model: string; diff --git a/scripts/test-docker-all.mjs b/scripts/test-docker-all.mjs index f4191ee63a05..5e3f6960a210 100644 --- a/scripts/test-docker-all.mjs +++ b/scripts/test-docker-all.mjs @@ -54,7 +54,7 @@ const IS_MAIN = process.argv[1] ? path.resolve(process.argv[1]) === fileURLToPath(import.meta.url) : false; -export function dockerAllUsage() { +function dockerAllUsage() { return [ "Usage: node scripts/test-docker-all.mjs [--plan-json]", "", diff --git a/scripts/test-group-report.mjs b/scripts/test-group-report.mjs index ea8bb6c58e1b..679c8615873e 100644 --- a/scripts/test-group-report.mjs +++ b/scripts/test-group-report.mjs @@ -641,7 +641,7 @@ function readReportInput(entry) { }; } -export function readReportInputs(entries) { +function readReportInputs(entries) { const invalid = []; const missing = []; const reports = []; diff --git a/scripts/test-live-shard.mjs b/scripts/test-live-shard.mjs index 8a18447478dc..cccbf832a547 100644 --- a/scripts/test-live-shard.mjs +++ b/scripts/test-live-shard.mjs @@ -586,7 +586,7 @@ export function validateLiveShardReportPayload( /** * Reads and validates the live-shard Vitest JSON report. */ -export function validateLiveShardReport(reportPath, expectedFiles = []) { +function validateLiveShardReport(reportPath, expectedFiles = []) { let payload; try { payload = JSON.parse(fs.readFileSync(reportPath, "utf8")); diff --git a/scripts/test-live.mjs b/scripts/test-live.mjs index 1ead41a23ef0..59f8b2e3449f 100644 --- a/scripts/test-live.mjs +++ b/scripts/test-live.mjs @@ -9,7 +9,7 @@ import { /** * Renders CLI usage for the live-test wrapper. */ -export function testLiveUsage() { +function testLiveUsage() { return [ "Usage: node scripts/test-live.mjs [options] [--] [vitest targets/args...]", "", diff --git a/scripts/transitive-manifest-risk-report.mjs b/scripts/transitive-manifest-risk-report.mjs index 7b1fca14d050..0f3332f964b2 100644 --- a/scripts/transitive-manifest-risk-report.mjs +++ b/scripts/transitive-manifest-risk-report.mjs @@ -603,7 +603,7 @@ export function renderTransitiveManifestRiskMarkdownReport(report) { return `${lines.join("\n")}\n`; } -export async function runTransitiveManifestRiskReport({ +async function runTransitiveManifestRiskReport({ rootDir = process.cwd(), fetchImpl = fetch, now = new Date(), diff --git a/scripts/tsdown-build.mjs b/scripts/tsdown-build.mjs index 726eeb8874dd..2ee5bb896649 100644 --- a/scripts/tsdown-build.mjs +++ b/scripts/tsdown-build.mjs @@ -486,7 +486,7 @@ function resolveTsdownEnv(env, params = {}) { }; } -export function tsdownBuildUsage() { +function tsdownBuildUsage() { return [ "Usage: node scripts/tsdown-build.mjs [tsdown args...]", "", diff --git a/scripts/ui.js b/scripts/ui.js index 3ee86b353b44..b14949a48ad2 100644 --- a/scripts/ui.js +++ b/scripts/ui.js @@ -333,7 +333,7 @@ export function main(argv = process.argv.slice(2)) { runPnpm(["run", script, ...rest]); } -export function resolveDirectExecutionPath(entry, realpath = fs.realpathSync.native) { +function resolveDirectExecutionPath(entry, realpath = fs.realpathSync.native) { const resolved = path.resolve(entry); try { return realpath(resolved); diff --git a/scripts/verify-plugin-npm-published-runtime.mjs b/scripts/verify-plugin-npm-published-runtime.mjs index eff3b0803287..04da8588111e 100644 --- a/scripts/verify-plugin-npm-published-runtime.mjs +++ b/scripts/verify-plugin-npm-published-runtime.mjs @@ -379,7 +379,7 @@ export function parseVerifyPublishedPluginRuntimeArgs(argv) { return { help: false, spec: first }; } -export async function verifyPublishedPluginRuntime(spec) { +async function verifyPublishedPluginRuntime(spec) { const workingDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-plugin-npm-runtime.")); try { const tarballPath = await packPublishedPackage(spec, workingDir); diff --git a/scripts/verify.mjs b/scripts/verify.mjs index 89f2a49bea33..e40cdbb5cb2d 100644 --- a/scripts/verify.mjs +++ b/scripts/verify.mjs @@ -25,7 +25,7 @@ export function usage() { /** * Parses verify wrapper CLI args. */ -export function parseVerifyArgs(argv) { +function parseVerifyArgs(argv) { const args = { help: false }; for (const arg of argv) { if (arg === "--help" || arg === "-h") { diff --git a/scripts/write-cli-startup-metadata.ts b/scripts/write-cli-startup-metadata.ts index 55f4f62aca24..856fe758ad99 100644 --- a/scripts/write-cli-startup-metadata.ts +++ b/scripts/write-cli-startup-metadata.ts @@ -270,7 +270,7 @@ function resolveSubcommandHelpSourceSignature(sourceRootDir: string = rootDir): return hash.digest("hex"); } -export function readBundledChannelCatalog( +function readBundledChannelCatalog( extensionsDirOverride: string = extensionsDir, ): BundledChannelCatalog { const entries: ExtensionChannelEntry[] = []; diff --git a/scripts/write-package-dist-inventory.ts b/scripts/write-package-dist-inventory.ts index 3af77df59d69..070e645b0a5b 100644 --- a/scripts/write-package-dist-inventory.ts +++ b/scripts/write-package-dist-inventory.ts @@ -4,7 +4,7 @@ import { pathToFileURL } from "node:url"; import { writePackageDistInventory } from "../src/infra/package-dist-inventory.ts"; -export async function writeCurrentPackageDistInventory(): Promise { +async function writeCurrentPackageDistInventory(): Promise { await writePackageDistInventory(process.cwd()); } diff --git a/ui/src/app/app-host.ts b/ui/src/app/app-host.ts index 71c0fe540faf..48b25737bf1f 100644 --- a/ui/src/app/app-host.ts +++ b/ui/src/app/app-host.ts @@ -127,7 +127,7 @@ function isTerminalAvailable( ); } -export class OpenClawApp extends LitElement { +class OpenClawApp extends LitElement { @state() private gatewayConnected = false; @state() private gatewayReconnecting = false; @state() private gatewayLastError: string | null = null; diff --git a/ui/src/components/app-sidebar.ts b/ui/src/components/app-sidebar.ts index f43088f026c5..380a72e90815 100644 --- a/ui/src/components/app-sidebar.ts +++ b/ui/src/components/app-sidebar.ts @@ -124,7 +124,7 @@ function shouldHandleNavigationClick(event: MouseEvent): boolean { ); } -export class AppSidebar extends LitElement { +class AppSidebar extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/app-topbar.ts b/ui/src/components/app-topbar.ts index 2e27245e03be..dff8cfc104f9 100644 --- a/ui/src/components/app-topbar.ts +++ b/ui/src/components/app-topbar.ts @@ -10,7 +10,7 @@ import { icons } from "./icons.ts"; // slide-over drawer; the one topbar toggle switches behavior there. const NAV_DRAWER_MEDIA_QUERY = "(max-width: 1100px)"; -export class AppTopbar extends LitElement { +class AppTopbar extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/connection-banner.ts b/ui/src/components/connection-banner.ts index e99f4946d3df..ea7845c4f7dc 100644 --- a/ui/src/components/connection-banner.ts +++ b/ui/src/components/connection-banner.ts @@ -28,7 +28,7 @@ function renderConnectionBanner(props: ConnectionBannerProps) { `; } -export class ConnectionBanner extends LitElement { +class ConnectionBanner extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/dashboard-header.ts b/ui/src/components/dashboard-header.ts index b3a6f34015ed..5126f0b59fe5 100644 --- a/ui/src/components/dashboard-header.ts +++ b/ui/src/components/dashboard-header.ts @@ -3,7 +3,7 @@ import { LitElement, html, nothing } from "lit"; import { property } from "lit/decorators.js"; import { titleForRoute, type NavigationRouteId } from "../app-navigation.ts"; -export class DashboardHeader extends LitElement { +class DashboardHeader extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/exec-approval.ts b/ui/src/components/exec-approval.ts index 08fa0b3d089a..e3bdb8e7afe9 100644 --- a/ui/src/components/exec-approval.ts +++ b/ui/src/components/exec-approval.ts @@ -224,7 +224,7 @@ function renderExecApprovalPrompt(props: ExecApprovalProps) { `; } -export class ExecApproval extends LitElement { +class ExecApproval extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/gateway-url-confirmation.ts b/ui/src/components/gateway-url-confirmation.ts index 2e587c21bc7f..f4588c3e67f4 100644 --- a/ui/src/components/gateway-url-confirmation.ts +++ b/ui/src/components/gateway-url-confirmation.ts @@ -45,7 +45,7 @@ function renderGatewayUrlConfirmation(props: GatewayUrlConfirmationProps) { `; } -export class GatewayUrlConfirmation extends LitElement { +class GatewayUrlConfirmation extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/login-gate.ts b/ui/src/components/login-gate.ts index 71c6213de1be..6134c6116337 100644 --- a/ui/src/components/login-gate.ts +++ b/ui/src/components/login-gate.ts @@ -108,7 +108,7 @@ function buildFeedback(params: { }; } -export function resolveLoginFailureFeedback( +function resolveLoginFailureFeedback( params: LoginFailureFeedbackParams, ): LoginFailureFeedback | null { if (params.connected || !params.lastError) { @@ -431,7 +431,7 @@ function renderLoginGate(props: LoginGateProps) { `; } -export class LoginGate extends LitElement { +class LoginGate extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/theme-mode-toggle.ts b/ui/src/components/theme-mode-toggle.ts index 8b311757397f..ece8a221df15 100644 --- a/ui/src/components/theme-mode-toggle.ts +++ b/ui/src/components/theme-mode-toggle.ts @@ -10,7 +10,7 @@ export type ThemeModeChangeDetail = { element: HTMLElement; }; -export class ThemeModeToggle extends LitElement { +class ThemeModeToggle extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/components/tooltip.ts b/ui/src/components/tooltip.ts index 9c4a961e5e78..49dbaabddc1a 100644 --- a/ui/src/components/tooltip.ts +++ b/ui/src/components/tooltip.ts @@ -16,7 +16,7 @@ function createTooltipId() { return `openclaw-tooltip-${nextTooltipId}`; } -export class TooltipProvider extends LitElement { +class TooltipProvider extends LitElement { @property({ type: Number }) delay = HOVER_DELAY; @property({ type: Number }) skipDelay = SKIP_DELAY; @property({ type: Number }) touchDelay = TOUCH_DELAY; @@ -99,7 +99,7 @@ export class TooltipProvider extends LitElement { } } -export class Tooltip extends LitElement { +class Tooltip extends LitElement { @property() content = ""; private trigger: HTMLElement | null = null; diff --git a/ui/src/components/update-banner.ts b/ui/src/components/update-banner.ts index dfa5e337f6c2..81f81b55a571 100644 --- a/ui/src/components/update-banner.ts +++ b/ui/src/components/update-banner.ts @@ -67,7 +67,7 @@ export type UpdateBannerProps = { onDismiss: () => void; }; -export class UpdateBanner extends LitElement { +class UpdateBanner extends LitElement { override createRenderRoot() { return this; } diff --git a/ui/src/pages/chat/chat-pane.ts b/ui/src/pages/chat/chat-pane.ts index 4c1554b87051..389d0cd25571 100644 --- a/ui/src/pages/chat/chat-pane.ts +++ b/ui/src/pages/chat/chat-pane.ts @@ -95,7 +95,7 @@ const NEW_SESSION_LIST_LOADING_MESSAGE = const NEW_SESSION_CREATE_FAILED_MESSAGE = "New Chat could not create a new session. Try again in a moment."; -export class ChatPane extends LitElement { +class ChatPane extends LitElement { @consume({ context: applicationContext, subscribe: false }) private context!: ChatPageContext; @property({ attribute: false }) paneId = "single"; diff --git a/ui/src/pages/chat/components/chat-sidebar.ts b/ui/src/pages/chat/components/chat-sidebar.ts index 462dcf60fc58..62c4693c41ee 100644 --- a/ui/src/pages/chat/components/chat-sidebar.ts +++ b/ui/src/pages/chat/components/chat-sidebar.ts @@ -592,7 +592,7 @@ export function renderMarkdownSidebar(props: MarkdownSidebarProps) { `; } -export class ChatDetailPanel extends LitElement { +class ChatDetailPanel extends LitElement { @property({ attribute: false }) content: SidebarContent | null = null; @property({ attribute: false }) loadFullMessage?: | ((request: SidebarFullMessageRequest) => Promise)