refactor(deadcode): localize script helper types (#101917)

This commit is contained in:
Vincent Koc
2026-07-07 16:59:51 -07:00
committed by GitHub
parent 0c6bb026b2
commit 3bbc2732c0
16 changed files with 33 additions and 34 deletions

View File

@@ -3,12 +3,12 @@ import fs from "node:fs/promises";
import path from "node:path";
import { readPositiveIntEnv } from "./env-limits.mjs";
export type SessionLogMentionLimits = {
type SessionLogMentionLimits = {
fileMaxBytes: number;
totalMaxBytes: number;
};
export type SessionLogNeedles = Record<string, string>;
type SessionLogNeedles = Record<string, string>;
const DEFAULT_FILE_MAX_BYTES = 4 * 1024 * 1024;
const DEFAULT_TOTAL_MAX_BYTES = 16 * 1024 * 1024;

View File

@@ -8,7 +8,7 @@ const cleanupSignals = ["SIGINT", "SIGTERM", "SIGHUP"] as const;
type CleanupSignal = (typeof cleanupSignals)[number];
export type E2eStateDir = {
type E2eStateDir = {
stateDir: string;
created: boolean;
cleanup: () => void;

View File

@@ -1,7 +1,7 @@
// Mcp Channel Limits script supports OpenClaw repository automation.
import { readPositiveIntEnv } from "./lib/env-limits.mjs";
export type McpChannelLimits = {
type McpChannelLimits = {
connectTimeoutMs: number;
gatewayEventRetainLimit: number;
rawMessageRetainLimit: number;

View File

@@ -16,7 +16,7 @@ type FetchJsonOptions = {
timeoutMs?: number;
};
export type McpCodeModeClientFetchLimits = {
type McpCodeModeClientFetchLimits = {
bodyMaxBytes: number;
timeoutMs: number;
};

View File

@@ -13,7 +13,7 @@ type TelegramBotApiOptions = {
const DEFAULT_BASE_URL =
process.env.OPENCLAW_TELEGRAM_USER_BOT_API_BASE_URL ?? "https://api.telegram.org";
export type TelegramBotApiLimits = {
type TelegramBotApiLimits = {
bodyMaxBytes: number;
timeoutMs: number;
};

View File

@@ -14,7 +14,7 @@ type AndroidVersionManifest = {
versionCode: number;
};
export type ResolvedAndroidVersion = {
type ResolvedAndroidVersion = {
canonicalVersion: string;
changelogPath: string;
releaseNotesPath: string;

View File

@@ -3,7 +3,7 @@ import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
export type BuildCopyContext = {
type BuildCopyContext = {
prefix: string;
projectRoot: string;
verbose: boolean;

View File

@@ -18,7 +18,7 @@ export type StopChildResult = ChildExit & {
exitedBeforeTeardown: boolean;
};
export type StopChildOptions = {
type StopChildOptions = {
killGraceMs?: number;
platform?: NodeJS.Platform;
runTaskkill?: typeof spawnSync;

View File

@@ -2,8 +2,8 @@
import { randomUUID } from "node:crypto";
import WebSocket from "ws";
export type GatewayReqFrame = { type: "req"; id: string; method: string; params?: unknown };
export type GatewayResFrame = {
type GatewayReqFrame = { type: "req"; id: string; method: string; params?: unknown };
type GatewayResFrame = {
type: "res";
id: string;
ok: boolean;

View File

@@ -1,7 +1,7 @@
// Npm Verify Exec script supports OpenClaw repository automation.
import { execFileSync } from "node:child_process";
export type NpmVerifyCommandInvocation = {
type NpmVerifyCommandInvocation = {
command: string;
args: string[];
windowsVerbatimArguments?: boolean;

View File

@@ -22,7 +22,7 @@ type ClawHubDispatchTarget = {
inputs: ClawHubDispatchInputs;
};
export type OpenClawReleaseClawHubPlanArgs = {
type OpenClawReleaseClawHubPlanArgs = {
releaseTag: string;
releasePublishBranch: string;
releasePublishRunId: string;
@@ -30,7 +30,7 @@ export type OpenClawReleaseClawHubPlanArgs = {
plugins: string[];
};
export type OpenClawReleaseClawHubPlan = {
type OpenClawReleaseClawHubPlan = {
clawHubWorkflowRef: string;
releasePublishBranch: string;
normal: ClawHubDispatchTarget;
@@ -48,7 +48,7 @@ export type OpenClawReleaseClawHubPlan = {
};
};
export type OpenClawReleaseClawHubRuntimeStateArgs = {
type OpenClawReleaseClawHubRuntimeStateArgs = {
repository: string;
waitForClawHub: boolean;
forceSkipClawHub: boolean;
@@ -57,7 +57,7 @@ export type OpenClawReleaseClawHubRuntimeStateArgs = {
bootstrapCompleted: boolean;
};
export type OpenClawReleaseClawHubRuntimeState = {
type OpenClawReleaseClawHubRuntimeState = {
verifierArgs: string[];
proofLines: {
normal: string;

View File

@@ -76,7 +76,7 @@ export type GitRangeSelection = {
headRef: string;
};
export type ParsedPluginReleaseArgs = {
type ParsedPluginReleaseArgs = {
selection: string[];
selectionMode?: PluginReleaseSelectionMode;
pluginsFlagProvided: boolean;
@@ -98,14 +98,13 @@ function parsePluginNpmDistTagOverride(value: string | undefined): "extended-sta
throw new Error(`Unknown npm dist-tag override: ${value}. Expected "extended-stable".`);
}
export type PublishablePluginPackageCandidate<
TPackageJson extends PluginPackageJson = PluginPackageJson,
> = {
extensionId: string;
packageDir: string;
packageJson: TPackageJson;
readmeText?: string;
};
type PublishablePluginPackageCandidate<TPackageJson extends PluginPackageJson = PluginPackageJson> =
{
extensionId: string;
packageDir: string;
packageJson: TPackageJson;
readmeText?: string;
};
export const OPENCLAW_PLUGIN_NPM_REPOSITORY_URL = "https://github.com/openclaw/openclaw";
@@ -402,7 +401,7 @@ export function collectPublishablePluginPackageErrors(
return errors;
}
export type PublishablePluginPackageFilters = {
type PublishablePluginPackageFilters = {
extensionIds?: readonly string[];
packageNames?: readonly string[];
npmDistTag?: "extended-stable";

View File

@@ -11,7 +11,7 @@ import {
type JsonRecord = Record<string, unknown>;
export type ReleaseVerifyBetaArgs = {
type ReleaseVerifyBetaArgs = {
version: string;
tag: string;
distTag: string;
@@ -35,7 +35,7 @@ export type ReleaseVerifyBetaArgs = {
};
};
export type NpmViewFields = {
type NpmViewFields = {
version?: string;
distTagVersion?: string;
integrity?: string;

View File

@@ -1,15 +1,15 @@
import path from "node:path";
export type VersionScriptFormat = "json" | "shell";
export type VersionQueryCliOptions = {
type VersionScriptFormat = "json" | "shell";
type VersionQueryCliOptions = {
field: string | null;
format: VersionScriptFormat;
help: boolean;
releaseVersion: string | null;
rootDir: string;
};
export type VersionSyncMode = "check" | "write";
export type VersionSyncCliOptions = {
type VersionSyncMode = "check" | "write";
type VersionSyncCliOptions = {
help: boolean;
mode: VersionSyncMode;
releaseVersion: string | null;

View File

@@ -10,7 +10,7 @@ import { collectFilesSync, isCodeFile, toPosixPath } from "./check-file-utils.js
type EnvMutationOperation = "assign" | "delete" | "replace" | "stubEnv";
export type TestEnvMutationFinding = {
type TestEnvMutationFinding = {
allowed: boolean;
allowReason?: string;
excerpt: string;

View File

@@ -20,7 +20,7 @@ type SkipInventoryReason =
type SkipInventoryTarget = "describe" | "it" | "test" | "unknown";
export type TestSkipInventoryFinding = {
type TestSkipInventoryFinding = {
excerpt: string;
file: string;
kind: SkipInventoryKind;