diff --git a/packages/coding-agent/src/discovery/agent-plugin-format.ts b/packages/coding-agent/src/discovery/agent-plugin-format.ts index 5da841d55..c2308c7de 100644 --- a/packages/coding-agent/src/discovery/agent-plugin-format.ts +++ b/packages/coding-agent/src/discovery/agent-plugin-format.ts @@ -74,13 +74,13 @@ export interface AgentPluginManifest { * - `invalid` — the document targets Agent Plugins but violates the closed schema * fatally; the plugin must be rejected and none of its components loaded (spec §5.2). */ -export type AgentPluginManifestResult = +type AgentPluginManifestResult = | { status: "none" } | { status: "valid"; manifest: AgentPluginManifest; warnings: string[] } | { status: "invalid"; reason: string }; /** Enforce the plugin `name` constraints from spec §5.5. */ -export function isValidAgentPluginName(name: string): boolean { +function isValidAgentPluginName(name: string): boolean { if (name.length < 1 || name.length > 64) return false; if (!/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/.test(name)) return false; return !name.includes("--") && !name.includes(".."); @@ -240,14 +240,14 @@ export function parseAgentPluginManifest(raw: string): AgentPluginManifestResult * (spec §9.2). Single non-recursive pass; replacement text is never rescanned, * and no other placeholder or environment-variable expansion is performed. */ -export function expandAgentPluginPlaceholders(value: string, pluginRoot: string, pluginData: string): string { +function expandAgentPluginPlaceholders(value: string, pluginRoot: string, pluginData: string): string { return value.replace(/\$\{PLUGIN_(ROOT|DATA)\}/g, (_match, which: string) => which === "ROOT" ? pluginRoot : pluginData, ); } /** A validated `mcp.json` server entry, resolved to launch-ready values. */ -export interface AgentPluginMcpServer { +interface AgentPluginMcpServer { name: string; transport: "stdio" | "http" | "sse"; /** Absolute path for `./`-relative commands; bare executable token otherwise. */ @@ -268,11 +268,11 @@ export interface AgentPluginMcpServer { * - `ok` — the document is valid; individually invalid server entries are * skipped with a warning (spec §7.2.2 rule 3). */ -export type AgentPluginMcpResult = +type AgentPluginMcpResult = | { status: "disabled"; reason: string } | { status: "ok"; servers: AgentPluginMcpServer[]; warnings: string[] }; -export interface AgentPluginMcpOptions { +interface AgentPluginMcpOptions { /** Filesystem-resolved plugin root. */ pluginRoot: string; /** Client-managed persistent data directory for this plugin (spec §9.1). */ @@ -488,7 +488,7 @@ export async function parseAgentPluginMcp(raw: string, options: AgentPluginMcpOp * - `invalid` — the root claims Agent Plugins conformance but its manifest is * fatally invalid; no component may be discovered or executed (spec §11.3). */ -export type AgentPluginRootStatus = +type AgentPluginRootStatus = | { kind: "none" } | { kind: "standard"; manifest: AgentPluginManifest; warnings: string[]; realRoot: string } | { kind: "invalid"; reason: string }; diff --git a/packages/coding-agent/src/discovery/contained-path.ts b/packages/coding-agent/src/discovery/contained-path.ts index b8f2e7732..882173e04 100644 --- a/packages/coding-agent/src/discovery/contained-path.ts +++ b/packages/coding-agent/src/discovery/contained-path.ts @@ -14,7 +14,7 @@ import * as fs from "node:fs"; import * as path from "node:path"; /** Lexical containment: `target` is `base` itself or a descendant of it. */ -export function isContained(base: string, target: string): boolean { +function isContained(base: string, target: string): boolean { const relative = path.relative(base, target); return relative === "" || (!relative.startsWith("..") && !path.isAbsolute(relative)); } @@ -29,10 +29,7 @@ export async function realpathIfExists(p: string): Promise { } /** Outcome of resolving a fixed package path without reading it. */ -export type ContainedPathResolution = - | { status: "missing" } - | { status: "outside" } - | { status: "ok"; realPath: string }; +type ContainedPathResolution = { status: "missing" } | { status: "outside" } | { status: "ok"; realPath: string }; /** * Resolve a fixed package path WITHOUT reading it: symlinks and equivalent diff --git a/packages/coding-agent/src/mcp/transports/header-policy.ts b/packages/coding-agent/src/mcp/transports/header-policy.ts index 3eb1f5d43..ee278e22e 100644 --- a/packages/coding-agent/src/mcp/transports/header-policy.ts +++ b/packages/coding-agent/src/mcp/transports/header-policy.ts @@ -14,7 +14,7 @@ */ /** Header buckets for one MCP HTTP request. */ -export interface MCPHeaderSources { +interface MCPHeaderSources { /** Client-generated HTTP/MCP/authorization headers; win case-insensitively. */ generated: Record; /** Configured headers from the server entry (package or user config). */ diff --git a/packages/coding-agent/src/modes/components/agent-hub-projection.ts b/packages/coding-agent/src/modes/components/agent-hub-projection.ts index 6d908c527..aae33b634 100644 --- a/packages/coding-agent/src/modes/components/agent-hub-projection.ts +++ b/packages/coding-agent/src/modes/components/agent-hub-projection.ts @@ -10,7 +10,7 @@ export interface AggregateMetrics extends AgentMetrics { activeDurationAgents: number; } -export interface AgentTreeProjection { +interface AgentTreeProjection { rows: AgentRef[]; depthById: Map; parentById: Map; @@ -65,7 +65,7 @@ export function progressMetrics(observed: ObservableSession | undefined): AgentM * usage embedded in completed `task` tool results, so using it for a parent * row would double-count child rows in the aggregate. */ -export function readSessionMetrics(session: NonNullable): AgentMetrics | undefined { +function readSessionMetrics(session: NonNullable): AgentMetrics | undefined { try { const stats = session.getSessionStats(); const messages = session.agent?.state?.messages; diff --git a/packages/coding-agent/src/modes/components/agent-hub-renderer.ts b/packages/coding-agent/src/modes/components/agent-hub-renderer.ts index 3200b76bd..e260a7e56 100644 --- a/packages/coding-agent/src/modes/components/agent-hub-renderer.ts +++ b/packages/coding-agent/src/modes/components/agent-hub-renderer.ts @@ -16,7 +16,7 @@ export interface RosterRender { } /** Legacy progress snapshots may omit counters; snapshot absence remains distinct. */ -export function metricNumber(value: number | undefined): number { +function metricNumber(value: number | undefined): number { return typeof value === "number" && Number.isFinite(value) ? value : 0; } @@ -67,7 +67,7 @@ export function statusText(status: AgentRef["status"], text: string): string { } /** Model id + thinking level (`sonnet-4-6 ◒ high`), level colored per theme. */ -export function formatModelBadge(modelId: string, level: ThinkingLevel | undefined): string { +function formatModelBadge(modelId: string, level: ThinkingLevel | undefined): string { const model = theme.fg("muted", sanitizeDisplayText(modelId)); if (!level || level === ThinkingLevel.Off || level === ThinkingLevel.Inherit) return model; const display = theme.thinking[level as keyof typeof theme.thinking] ?? level; @@ -81,11 +81,7 @@ export function formatRoleBadge(role: string, settings: Settings): string { } /** Format a resolved selector, preserving provider identity when requested. */ -export function formatResolvedModelBadge( - resolved: string, - preserveProvider = false, - fallbackLevel?: ThinkingLevel, -): string { +function formatResolvedModelBadge(resolved: string, preserveProvider = false, fallbackLevel?: ThinkingLevel): string { const cleanResolved = sanitizeDisplayText(resolved); // Model ids may themselves contain colons (`qwen3:14b`), so only treat the // suffix as a thinking level when it parses as one. diff --git a/packages/coding-agent/src/registry/agent-registry.ts b/packages/coding-agent/src/registry/agent-registry.ts index 2b5929184..500aef6e3 100644 --- a/packages/coding-agent/src/registry/agent-registry.ts +++ b/packages/coding-agent/src/registry/agent-registry.ts @@ -15,7 +15,7 @@ import { oneLineLabel } from "../task/types"; export const MAIN_AGENT_ID = "Main"; /** Sidecar marker retained beside a child transcript after an explicit kill. */ -export const AGENT_TOMBSTONE_SUFFIX = ".tombstone"; +const AGENT_TOMBSTONE_SUFFIX = ".tombstone"; export function getAgentTombstonePath(sessionFile: string): string { return `${sessionFile}${AGENT_TOMBSTONE_SUFFIX}`; @@ -30,7 +30,7 @@ export function getAgentTombstonePath(sessionFile: string): string { */ export type AgentStatus = "running" | "idle" | "parked" | "aborted"; /** Provenance of a displayed duration: active runtime, transcript span, or unavailable. */ -export type AgentDurationKind = "active" | "span" | "unknown"; +type AgentDurationKind = "active" | "span" | "unknown"; /** * - `main`/`sub`: the user-facing agent tree (driving agent + task subagents). * - `advisor`: a passive review transcript persisted like a subagent for usage diff --git a/packages/coding-agent/src/tools/shell-tokenize.ts b/packages/coding-agent/src/tools/shell-tokenize.ts index 6c26b2669..97622dd27 100644 --- a/packages/coding-agent/src/tools/shell-tokenize.ts +++ b/packages/coding-agent/src/tools/shell-tokenize.ts @@ -87,7 +87,7 @@ export function tokenizeShellSegments(command: string): string[][] { * * @see extractFlatShellCommandSegments */ -export interface FlatShellCommandSegment { +interface FlatShellCommandSegment { /** Original segment text with quoting and escaping preserved. */ text: string; /** diff --git a/packages/coding-agent/src/utils/changelog.ts b/packages/coding-agent/src/utils/changelog.ts index b64431dae..e59d46758 100644 --- a/packages/coding-agent/src/utils/changelog.ts +++ b/packages/coding-agent/src/utils/changelog.ts @@ -201,7 +201,7 @@ function parseChangelogContent(content: string): ChangelogEntry[] { * Compare changelog entries by their parsed version parts. * Returns: -1 if v1 < v2, 0 if v1 === v2, 1 if v1 > v2 */ -export function compareChangelogEntries(v1: ChangelogEntry, v2: ChangelogEntry): number { +function compareChangelogEntries(v1: ChangelogEntry, v2: ChangelogEntry): number { if (v1.major !== v2.major) return v1.major - v2.major; if (v1.minor !== v2.minor) return v1.minor - v2.minor; return v1.patch - v2.patch;