Skip to content

Commit e35c7a3

Browse files
authored
refactor(agents): localize internal-only symbols (#100909)
1 parent 3c84a84 commit e35c7a3

29 files changed

Lines changed: 36 additions & 41 deletions

src/agents/acp-spawn.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ const ACP_RUNTIME_TIMEOUT_MAX_SECONDS = 24 * 60 * 60;
118118

119119
export const ACP_SPAWN_MODES = ["run", "session"] as const;
120120
export type SpawnAcpMode = (typeof ACP_SPAWN_MODES)[number];
121-
export const ACP_SPAWN_SANDBOX_MODES = ["inherit", "require"] as const;
121+
const ACP_SPAWN_SANDBOX_MODES = ["inherit", "require"] as const;
122122
export type SpawnAcpSandboxMode = (typeof ACP_SPAWN_SANDBOX_MODES)[number];
123123
export const ACP_SPAWN_STREAM_TARGETS = ["parent"] as const;
124-
export type SpawnAcpStreamTarget = (typeof ACP_SPAWN_STREAM_TARGETS)[number];
124+
type SpawnAcpStreamTarget = (typeof ACP_SPAWN_STREAM_TARGETS)[number];
125125

126-
export type SpawnAcpParams = {
126+
type SpawnAcpParams = {
127127
task: string;
128128
label?: string;
129129
agentId?: string;
@@ -182,7 +182,7 @@ export type SpawnAcpContext = {
182182
inheritedToolDenylist?: string[];
183183
};
184184

185-
export const ACP_SPAWN_ERROR_CODES = [
185+
const ACP_SPAWN_ERROR_CODES = [
186186
"acp_disabled",
187187
"requester_session_required",
188188
"runtime_policy",

src/agents/agent-bundle-lsp-runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type LspServerCapabilities = {
5151
};
5252

5353
/** Materialized LSP tools plus session capabilities and cleanup handle. */
54-
export type BundleLspToolRuntime = {
54+
type BundleLspToolRuntime = {
5555
tools: AnyAgentTool[];
5656
sessions: Array<{ serverName: string; capabilities: LspServerCapabilities }>;
5757
dispose: () => Promise<void>;

src/agents/bash-tools.exec-runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function emitExecProcessCompleted(params: {
200200
}
201201

202202
/** Renders a host label for user-facing exec policy messages. */
203-
export function renderExecHostLabel(host: ExecHost) {
203+
function renderExecHostLabel(host: ExecHost) {
204204
return host === "sandbox" ? "sandbox" : host === "gateway" ? "gateway" : "node";
205205
}
206206

src/agents/cli-runner/claude-skills-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function sanitizeSkillDirName(name: string, used: Set<string>): string {
3535
}
3636

3737
/** Returns whether a resolved skill file is readable before linking it into the Claude plugin. */
38-
export function isClaudeCliSkillFileAccessible(skillFilePath: string): boolean {
38+
function isClaudeCliSkillFileAccessible(skillFilePath: string): boolean {
3939
try {
4040
accessSync(skillFilePath);
4141
return true;

src/agents/cli-runner/reseed-envelope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const RESEED_PREFIX = `${RESEED_HEADER}\n`;
1010
const RESEED_USER_BOUNDARY = "\n</conversation_history>\n\n<next_user_message>\n";
1111
const RESEED_USER_CLOSE = "\n</next_user_message>";
1212

13-
export type ParsedCliReseedPrompt =
13+
type ParsedCliReseedPrompt =
1414
| { kind: "none" }
1515
| { kind: "legacy"; userMessage: string }
1616
| { kind: "invalid" };

src/agents/cli-session.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,7 @@ export function clearAllCliSessions(entry: Partial<MutableCliSessionFields>): vo
114114
entry.claudeCliSessionId = undefined;
115115
}
116116

117-
export type CliSessionInvalidatedReason =
118-
| "auth-profile"
119-
| "auth-epoch"
120-
| "message-policy"
121-
| "cwd"
122-
| "mcp";
117+
type CliSessionInvalidatedReason = "auth-profile" | "auth-epoch" | "message-policy" | "cwd" | "mcp";
123118

124119
export type CliSessionContentDriftReason = "system-prompt" | "prompt-tools";
125120

src/agents/code-mode-control-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const CODE_MODE_WAIT_TOOL_NAME = "wait";
1414
export const CODE_MODE_EXEC_TOOL_KIND = "code_mode_exec";
1515

1616
/** Hook metadata kind type for Code Mode exec tools. */
17-
export type CodeModeExecToolKind = typeof CODE_MODE_EXEC_TOOL_KIND;
17+
type CodeModeExecToolKind = typeof CODE_MODE_EXEC_TOOL_KIND;
1818
/** Source language accepted by the Code Mode exec tool. */
1919
export type CodeModeExecToolInputKind = "javascript" | "typescript";
2020
/** Metadata attached to before-tool-call events for Code Mode exec. */

src/agents/embedded-agent-helpers/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@ export function formatAssistantErrorText(
15871587
return raw.length > 600 ? `${truncateUtf16Safe(raw, 600)}…` : raw;
15881588
}
15891589

1590-
export function isRawAssistantErrorPassthrough(params: {
1590+
function isRawAssistantErrorPassthrough(params: {
15911591
friendlyError?: string;
15921592
rawError?: string;
15931593
}): boolean {
@@ -1653,7 +1653,7 @@ const IMAGE_DIMENSION_ERROR_RE =
16531653
const IMAGE_DIMENSION_PATH_RE = /messages\.(\d+)\.content\.(\d+)\.image/i;
16541654
const IMAGE_SIZE_ERROR_RE = /image exceeds\s*(\d+(?:\.\d+)?)\s*mb/i;
16551655

1656-
export function isMissingToolCallInputError(raw: string): boolean {
1656+
function isMissingToolCallInputError(raw: string): boolean {
16571657
if (!raw) {
16581658
return false;
16591659
}

src/agents/embedded-agent-runner/run/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type EmbeddedRunAttemptBase = Omit<
4343
| "sessionFile"
4444
>;
4545

46-
export type EmbeddedRunContextWindowInfo = {
46+
type EmbeddedRunContextWindowInfo = {
4747
tokens: number;
4848
referenceTokens?: number;
4949
source: "model" | "modelsConfig" | "agentContextTokens" | "default";

src/agents/model-selection-shared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ export type ModelRefStatus = {
11171117
allowed: boolean;
11181118
};
11191119

1120-
export type ResolveAllowedModelRefResult =
1120+
type ResolveAllowedModelRefResult =
11211121
| { ref: ModelRef; key: string }
11221122
| {
11231123
error: string;

0 commit comments

Comments
 (0)