Compare commits

...

7 Commits

Author SHA1 Message Date
claude-code-best
872ee280e3 chore: 2.1.0 2026-05-05 21:22:20 +08:00
claude-code-best
f5c9880d7d Merge pull request #413 from claude-code-best/performance/20260505/memory-leak-fix
feat: 继续进行内存泄露修复及垃圾代码清理
2026-05-05 21:21:22 +08:00
claude-code-best
3f1c8468bf fix: 调小 snapshots 的范围 2026-05-05 21:09:02 +08:00
claude-code-best
0ad6349434 chore: 清理 18 处未使用导入、变量和函数
移除未使用的导入(getSubscriptionType、isEnvDefinedFalsy、
getClaudeConfigHomeDir 等)、未使用的常量(ACCENT_COLOR、
NAME_MATCH_BONUS、CLIPBOARD_THRESHOLD)和死函数
(getOpus41Option、pasteViaClipboard),
为未使用参数添加 _ 前缀。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 20:15:51 +08:00
claude-code-best
1ac18aec0d chore: 清理 4 处遗漏的未使用导入和参数
移除 autonomyStatus/betas/claudemd/executorCrossPlatform 中
未使用的导入和参数。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 20:05:50 +08:00
claude-code-best
fcbc882232 chore: 清理 src 下 113 项未使用导入和死代码
删除未使用的文件(BuiltinStatusLine.tsx、4 个重复的 .ts stub)、
移除约 55 个文件中未使用的 React 导入、
清理约 50 处未使用的导入/变量/参数。
净减少 ~296 行代码,precheck 4077 测试全部通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 20:05:15 +08:00
claude-code-best
87b96199f9 feat: ai 的随机修复 2026-05-05 19:36:38 +08:00
143 changed files with 304 additions and 464 deletions

View File

@@ -21,7 +21,13 @@ const result = await Bun.build({
outdir, outdir,
target: 'bun', target: 'bun',
splitting: true, splitting: true,
define: getMacroDefines(), define: {
...getMacroDefines(),
// React production mode — eliminates _debugStack Error objects
// (6,889 objects × ~1.7KB = 12MB in development builds) and removes
// prop-type / key warnings not useful in a production CLI tool.
'process.env.NODE_ENV': JSON.stringify('production'),
},
features, features,
}) })

View File

@@ -1,6 +1,6 @@
{ {
"name": "claude-code-best", "name": "claude-code-best",
"version": "2.0.5", "version": "2.1.0",
"description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal", "description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
"type": "module", "type": "module",
"author": "claude-code-best <claude-code-best@proton.me>", "author": "claude-code-best <claude-code-best@proton.me>",

View File

@@ -14,7 +14,12 @@ const __dirname = dirname(__filename)
const projectRoot = join(__dirname, '..') const projectRoot = join(__dirname, '..')
const cliPath = join(projectRoot, 'src/entrypoints/cli.tsx') const cliPath = join(projectRoot, 'src/entrypoints/cli.tsx')
const defines = getMacroDefines() const defines = {
...getMacroDefines(),
// React production mode — prevents 6,889+ _debugStack Error objects
// (12MB) from accumulating during long-running sessions.
'process.env.NODE_ENV': JSON.stringify('production'),
}
const defineArgs = Object.entries(defines).flatMap(([k, v]) => [ const defineArgs = Object.entries(defines).flatMap(([k, v]) => [
'-d', '-d',

View File

@@ -41,11 +41,7 @@ import { type Tools, type ToolUseContext, toolMatchesName } from './Tool.js'
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js' import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'
import { SYNTHETIC_OUTPUT_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/SyntheticOutputTool/SyntheticOutputTool.js' import { SYNTHETIC_OUTPUT_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/SyntheticOutputTool/SyntheticOutputTool.js'
import type { APIError } from '@anthropic-ai/sdk' import type { APIError } from '@anthropic-ai/sdk'
import type { import type { Message, SystemCompactBoundaryMessage } from './types/message.js'
CompactMetadata,
Message,
SystemCompactBoundaryMessage,
} from './types/message.js'
import type { OrphanedPermission } from './types/textInputTypes.js' import type { OrphanedPermission } from './types/textInputTypes.js'
import { createAbortController } from './utils/abortController.js' import { createAbortController } from './utils/abortController.js'
import type { AttributionState } from './utils/commitAttribution.js' import type { AttributionState } from './utils/commitAttribution.js'

View File

@@ -1,5 +1,4 @@
import { feature } from 'bun:bundle' import { feature } from 'bun:bundle'
import { getKairosActive } from '../bootstrap/state.js'
import { getFeatureValue_CACHED_MAY_BE_STALE } from '../services/analytics/growthbook.js' import { getFeatureValue_CACHED_MAY_BE_STALE } from '../services/analytics/growthbook.js'
/** /**

View File

@@ -11,7 +11,6 @@ import {
logEvent, logEvent,
logEventAsync, logEventAsync,
} from '../services/analytics/index.js' } from '../services/analytics/index.js'
import { isInBundledMode } from '../utils/bundledMode.js'
import { getBootstrapArgs, getScriptPath } from '../utils/cliLaunch.js' import { getBootstrapArgs, getScriptPath } from '../utils/cliLaunch.js'
import { logForDebugging } from '../utils/debug.js' import { logForDebugging } from '../utils/debug.js'
import { rcLog } from './rcDebugLog.js' import { rcLog } from './rcDebugLog.js'

View File

@@ -72,7 +72,6 @@ import type {
SDKControlResponse, SDKControlResponse,
} from '../entrypoints/sdk/controlTypes.js' } from '../entrypoints/sdk/controlTypes.js'
import type { StdoutMessage } from '../entrypoints/sdk/controlTypes.js' import type { StdoutMessage } from '../entrypoints/sdk/controlTypes.js'
import type { SDKResultSuccess } from '../entrypoints/sdk/coreTypes.js'
import type { PermissionMode } from '../utils/permissions/PermissionMode.js' import type { PermissionMode } from '../utils/permissions/PermissionMode.js'
import { setSessionMetadataChangedListener } from '../utils/sessionState.js' import { setSessionMetadataChangedListener } from '../utils/sessionState.js'

View File

@@ -55,7 +55,6 @@ import type {
SDKControlResponse, SDKControlResponse,
} from '../entrypoints/sdk/controlTypes.js' } from '../entrypoints/sdk/controlTypes.js'
import type { StdoutMessage } from '../entrypoints/sdk/controlTypes.js' import type { StdoutMessage } from '../entrypoints/sdk/controlTypes.js'
import type { SDKResultSuccess } from '../entrypoints/sdk/coreTypes.js'
/** /**
* StdoutMessage with optional session_id. The transport layer accepts * StdoutMessage with optional session_id. The transport layer accepts

View File

@@ -2,7 +2,6 @@
* Companion display card — shown by /buddy (no args). * Companion display card — shown by /buddy (no args).
* Mirrors official vc8 component: bordered box with sprite, stats, last reaction. * Mirrors official vc8 component: bordered box with sprite, stats, last reaction.
*/ */
import React from 'react';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import { useInput } from '@anthropic/ink'; import { useInput } from '@anthropic/ink';
import { renderSprite } from './sprites.js'; import { renderSprite } from './sprites.js';

View File

@@ -6,7 +6,6 @@
import { stat } from 'fs/promises'; import { stat } from 'fs/promises';
import pMap from 'p-map'; import pMap from 'p-map';
import { cwd } from 'process'; import { cwd } from 'process';
import React from 'react';
import { MCPServerDesktopImportDialog } from '../../components/MCPServerDesktopImportDialog.js'; import { MCPServerDesktopImportDialog } from '../../components/MCPServerDesktopImportDialog.js';
import { wrappedRender as render } from '@anthropic/ink'; import { wrappedRender as render } from '@anthropic/ink';
import { KeybindingSetup } from '../../keybindings/KeybindingProviderSetup.js'; import { KeybindingSetup } from '../../keybindings/KeybindingProviderSetup.js';

View File

@@ -112,7 +112,6 @@ import type {
ModelInfo, ModelInfo,
SDKMessage, SDKMessage,
SDKUserMessage, SDKUserMessage,
SDKUserMessageReplay,
PermissionResult, PermissionResult,
McpServerConfigForProcessTransport, McpServerConfigForProcessTransport,
McpServerStatus, McpServerStatus,
@@ -5477,7 +5476,7 @@ function getStructuredIO(
*/ */
export async function handleOrphanedPermissionResponse({ export async function handleOrphanedPermissionResponse({
message, message,
setAppState, setAppState: _setAppState,
onEnqueued, onEnqueued,
handledToolUseIds, handledToolUseIds,
}: { }: {

View File

@@ -1,5 +1,5 @@
import * as React from 'react'; import * as React from 'react';
import { useEffect, useState } from 'react'; import { useState } from 'react';
import { resolve } from 'path'; import { resolve } from 'path';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import { Dialog } from '../../components/design-system/Dialog.js'; import { Dialog } from '../../components/design-system/Dialog.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { Settings } from '../../components/Settings/Settings.js'; import { Settings } from '../../components/Settings/Settings.js';
import type { LocalJSXCommandCall } from '../../types/command.js'; import type { LocalJSXCommandCall } from '../../types/command.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import type { LocalJSXCommandCall } from '../../types/command.js'; import type { LocalJSXCommandCall } from '../../types/command.js';
export const call: LocalJSXCommandCall = async (onDone, context) => { export const call: LocalJSXCommandCall = async (onDone, context) => {

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { Doctor } from '../../screens/Doctor.js'; import { Doctor } from '../../screens/Doctor.js';
import type { LocalJSXCommandCall } from '../../types/command.js'; import type { LocalJSXCommandCall } from '../../types/command.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { HelpV2 } from '../../components/HelpV2/HelpV2.js'; import { HelpV2 } from '../../components/HelpV2/HelpV2.js';
import type { LocalJSXCommandCall } from '../../types/command.js'; import type { LocalJSXCommandCall } from '../../types/command.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { HooksConfigMenu } from '../../components/hooks/HooksConfigMenu.js'; import { HooksConfigMenu } from '../../components/hooks/HooksConfigMenu.js';
import { logEvent } from '../../services/analytics/index.js'; import { logEvent } from '../../services/analytics/index.js';
import { getTools } from '../../tools.js'; import { getTools } from '../../tools.js';

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react'; import { useCallback, useState } from 'react';
import TextInput from '../../components/TextInput.js'; import TextInput from '../../components/TextInput.js';
import { useTerminalSize } from '../../hooks/useTerminalSize.js'; import { useTerminalSize } from '../../hooks/useTerminalSize.js';
import { Box, color, Text, useTheme } from '@anthropic/ink'; import { Box, color, Text, useTheme } from '@anthropic/ink';

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react'; import { useCallback, useState } from 'react';
import TextInput from '../../components/TextInput.js'; import TextInput from '../../components/TextInput.js';
import { useTerminalSize } from '../../hooks/useTerminalSize.js'; import { useTerminalSize } from '../../hooks/useTerminalSize.js';
import { Box, color, Text, useTheme } from '@anthropic/ink'; import { Box, color, Text, useTheme } from '@anthropic/ink';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';
export function CheckGitHubStep() { export function CheckGitHubStep() {

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react'; import { useCallback, useState } from 'react';
import TextInput from '../../components/TextInput.js'; import TextInput from '../../components/TextInput.js';
import { useTerminalSize } from '../../hooks/useTerminalSize.js'; import { useTerminalSize } from '../../hooks/useTerminalSize.js';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import type { Workflow } from './types.js'; import type { Workflow } from './types.js';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js'; import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { Select } from 'src/components/CustomSelect/index.js'; import { Select } from 'src/components/CustomSelect/index.js';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';

View File

@@ -1,5 +1,4 @@
import figures from 'figures'; import figures from 'figures';
import React from 'react';
import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js'; import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import { useKeybinding } from '../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../keybindings/useKeybinding.js';

View File

@@ -1,5 +1,4 @@
import figures from 'figures'; import figures from 'figures';
import React from 'react';
import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js'; import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import { useKeybinding } from '../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../keybindings/useKeybinding.js';

View File

@@ -1,4 +1,3 @@
import { feature } from 'bun:bundle';
import * as React from 'react'; import * as React from 'react';
import { resetCostState } from '../../bootstrap/state.js'; import { resetCostState } from '../../bootstrap/state.js';
import { clearTrustedDeviceToken, enrollTrustedDevice } from '../../bridge/trustedDevice.js'; import { clearTrustedDeviceToken, enrollTrustedDevice } from '../../bridge/trustedDevice.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { PermissionRuleList } from '../../components/permissions/rules/PermissionRuleList.js'; import { PermissionRuleList } from '../../components/permissions/rules/PermissionRuleList.js';
import type { LocalJSXCommandCall } from '../../types/command.js'; import type { LocalJSXCommandCall } from '../../types/command.js';
import { createPermissionRetryMessage } from '../../utils/messages.js'; import { createPermissionRetryMessage } from '../../utils/messages.js';

View File

@@ -36,7 +36,7 @@ function getMergedEnv(): Record<string, string> {
return merged return merged
} }
const call: LocalCommandCall = async (args, context) => { const call: LocalCommandCall = async (args, _context) => {
const arg = args.trim().toLowerCase() const arg = args.trim().toLowerCase()
// No argument: show current provider // No argument: show current provider

View File

@@ -2,7 +2,7 @@ import { type ChildProcess } from 'child_process';
import { resolve } from 'path'; import { resolve } from 'path';
import * as React from 'react'; import * as React from 'react';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { getBridgeDisabledReason, isBridgeEnabled } from '../../bridge/bridgeEnabled.js'; import { getBridgeDisabledReason } from '../../bridge/bridgeEnabled.js';
import { getBridgeAccessToken } from '../../bridge/bridgeConfig.js'; import { getBridgeAccessToken } from '../../bridge/bridgeConfig.js';
import { BRIDGE_LOGIN_INSTRUCTION } from '../../bridge/types.js'; import { BRIDGE_LOGIN_INSTRUCTION } from '../../bridge/types.js';
import { Dialog } from '../../components/design-system/Dialog.js'; import { Dialog } from '../../components/design-system/Dialog.js';

View File

@@ -1,5 +1,4 @@
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.js'; import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.js';
import React from 'react';
import type { LocalJSXCommandCall, LocalJSXCommandOnDone } from '../../types/command.js'; import type { LocalJSXCommandCall, LocalJSXCommandOnDone } from '../../types/command.js';
import { checkOverageGate, confirmOverage, launchRemoteReview } from './reviewRemote.js'; import { checkOverageGate, confirmOverage, launchRemoteReview } from './reviewRemote.js';
import { UltrareviewOverageDialog } from './UltrareviewOverageDialog.js'; import { UltrareviewOverageDialog } from './UltrareviewOverageDialog.js';

View File

@@ -9,7 +9,6 @@ import {
exportInstincts, exportInstincts,
findPromotionCandidates, findPromotionCandidates,
generateSkillCandidates, generateSkillCandidates,
importInstincts,
ingestTranscript, ingestTranscript,
listKnownProjects, listKnownProjects,
loadInstincts, loadInstincts,

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { Stats } from '../../components/Stats.js'; import { Stats } from '../../components/Stats.js';
import type { LocalJSXCommandCall } from '../../types/command.js'; import type { LocalJSXCommandCall } from '../../types/command.js';

View File

@@ -1,4 +1,3 @@
import { readFileSync } from 'fs';
import { REMOTE_CONTROL_DISCONNECTED_MSG } from '../bridge/types.js'; import { REMOTE_CONTROL_DISCONNECTED_MSG } from '../bridge/types.js';
import type { Command } from '../commands.js'; import type { Command } from '../commands.js';
import { DIAMOND_OPEN } from '../constants/figures.js'; import { DIAMOND_OPEN } from '../constants/figures.js';
@@ -21,7 +20,6 @@ import { logForDebugging } from '../utils/debug.js';
import { errorMessage } from '../utils/errors.js'; import { errorMessage } from '../utils/errors.js';
import { logError } from '../utils/log.js'; import { logError } from '../utils/log.js';
import { enqueuePendingNotification } from '../utils/messageQueueManager.js'; import { enqueuePendingNotification } from '../utils/messageQueueManager.js';
import { ALL_MODEL_CONFIGS } from '../utils/model/configs.js';
import { updateTaskState } from '../utils/task/framework.js'; import { updateTaskState } from '../utils/task/framework.js';
import { archiveRemoteSession, teleportToRemote } from '../utils/teleport.js'; import { archiveRemoteSession, teleportToRemote } from '../utils/teleport.js';
import { pollForApprovedExitPlanMode, UltraplanPollError } from '../utils/ultraplan/ccrSession.js'; import { pollForApprovedExitPlanMode, UltraplanPollError } from '../utils/ultraplan/ccrSession.js';
@@ -36,13 +34,6 @@ import { registerCleanup } from '../utils/cleanupRegistry.js';
// TODO(prod-hardening): OAuth token may go stale over the 30min poll; // TODO(prod-hardening): OAuth token may go stale over the 30min poll;
// consider refresh. // consider refresh.
/**
* Multi-agent exploration is slow; 30min timeout.
*
* @deprecated use getUltraplanTimeoutMs()
*/
const ULTRAPLAN_TIMEOUT_MS = 30 * 60 * 1000;
export const CCR_TERMS_URL = 'https://code.claude.com/docs/en/claude-code-on-the-web'; export const CCR_TERMS_URL = 'https://code.claude.com/docs/en/claude-code-on-the-web';
export function getUltraplanTimeoutMs(): number { export function getUltraplanTimeoutMs(): number {
@@ -61,15 +52,6 @@ export function isUltraplanEnabled(): boolean {
); );
} }
// CCR runs against the first-party API — use the canonical ID, not the
// provider-specific string getModelStrings() would return (which may be a
// Bedrock ARN or Vertex ID on the local CLI). Read at call time, not module
// load: the GrowthBook cache is empty at import and `/config` Gates can flip
// it between invocations.
function getUltraplanModel(): string {
return getFeatureValue_CACHED_MAY_BE_STALE('tengu_ultraplan_model', ALL_MODEL_CONFIGS.opus47.firstParty);
}
// prompt.txt is wrapped in <system-reminder> so the CCR browser hides // prompt.txt is wrapped in <system-reminder> so the CCR browser hides
// scaffolding (CLI_BLOCK_TAGS dropped by stripSystemNotifications) // scaffolding (CLI_BLOCK_TAGS dropped by stripSystemNotifications)
// while the model still sees full text. // while the model still sees full text.
@@ -84,19 +66,6 @@ const _rawPrompt = require('../utils/ultraplan/prompt.txt');
/* eslint-enable @typescript-eslint/no-require-imports */ /* eslint-enable @typescript-eslint/no-require-imports */
const DEFAULT_INSTRUCTIONS: string = (typeof _rawPrompt === 'string' ? _rawPrompt : _rawPrompt.default).trimEnd(); const DEFAULT_INSTRUCTIONS: string = (typeof _rawPrompt === 'string' ? _rawPrompt : _rawPrompt.default).trimEnd();
// Dev-only prompt override resolved eagerly at module load.
// Gated to ant builds (USER_TYPE is a build-time define,
// so the override path is DCE'd from external builds).
// Shell-set env only, so top-level process.env read is fine
// — settings.env never injects this.
// @deprecated use buildUltraplanPrompt()
/* eslint-disable custom-rules/no-process-env-top-level, custom-rules/no-sync-fs -- ant-only dev override; eager top-level read is the point (crash at startup, not silently inside the slash-command try/catch) */
const ULTRAPLAN_INSTRUCTIONS: string =
process.env.USER_TYPE === 'ant' && process.env.ULTRAPLAN_PROMPT_FILE
? readFileSync(process.env.ULTRAPLAN_PROMPT_FILE, 'utf8').trimEnd()
: DEFAULT_INSTRUCTIONS;
/* eslint-enable custom-rules/no-process-env-top-level, custom-rules/no-sync-fs */
/** /**
* Assemble the initial CCR user message. seedPlan and blurb stay outside the * Assemble the initial CCR user message. seedPlan and blurb stay outside the
* system-reminder so the browser renders them; scaffolding is hidden. * system-reminder so the browser renders them; scaffolding is hidden.

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { Settings } from '../../components/Settings/Settings.js'; import { Settings } from '../../components/Settings/Settings.js';
import type { LocalJSXCommandCall } from '../../types/command.js'; import type { LocalJSXCommandCall } from '../../types/command.js';

View File

@@ -1,151 +0,0 @@
import React, { useEffect, useState } from 'react';
import { formatCost } from '../cost-tracker.js';
import { Box, Text, ProgressBar } from '@anthropic/ink';
import { formatTokens } from '../utils/format.js';
import { useTerminalSize } from '../hooks/useTerminalSize.js';
type RateLimitBucket = {
utilization: number;
resets_at: number;
};
type BuiltinStatusLineProps = {
modelName: string;
contextUsedPct: number;
usedTokens: number;
contextWindowSize: number;
totalCostUsd: number;
rateLimits: {
five_hour?: RateLimitBucket;
seven_day?: RateLimitBucket;
};
};
/**
* Format a countdown from now until the given epoch time (in seconds).
* Returns a compact human-readable string like "3h12m", "5d20h", "45m", or "now".
*/
export function formatCountdown(epochSeconds: number): string {
const diff = epochSeconds - Date.now() / 1000;
if (diff <= 0) return 'now';
const days = Math.floor(diff / 86400);
const hours = Math.floor((diff % 86400) / 3600);
const minutes = Math.floor((diff % 3600) / 60);
if (days >= 1) return `${days}d${hours}h`;
if (hours >= 1) return `${hours}h${minutes}m`;
return `${minutes}m`;
}
function Separator() {
return <Text dimColor>{' \u2502 '}</Text>;
}
function BuiltinStatusLineInner({
modelName,
contextUsedPct,
usedTokens,
contextWindowSize,
totalCostUsd,
rateLimits,
}: BuiltinStatusLineProps) {
const { columns } = useTerminalSize();
// Force re-render every 60s so countdowns stay current
const [tick, setTick] = useState(0);
useEffect(() => {
const hasResetTime = (rateLimits.five_hour?.resets_at ?? 0) || (rateLimits.seven_day?.resets_at ?? 0);
if (!hasResetTime) return;
const id = setInterval(() => setTick(t => t + 1), 60_000);
return () => clearInterval(id);
}, [rateLimits.five_hour?.resets_at, rateLimits.seven_day?.resets_at]);
// Suppress unused-variable lint for tick (it exists only to trigger re-renders)
void tick;
// Model display: use first two words (e.g. "Opus 4.6") instead of just first word
const modelParts = modelName.split(' ');
const shortModel = modelParts.length >= 2 ? `${modelParts[0]} ${modelParts[1]}` : modelName;
const wide = columns >= 100;
const narrow = columns < 60;
const hasFiveHour = rateLimits.five_hour != null;
const hasSevenDay = rateLimits.seven_day != null;
const fiveHourPct = hasFiveHour ? Math.round(rateLimits.five_hour!.utilization * 100) : 0;
const sevenDayPct = hasSevenDay ? Math.round(rateLimits.seven_day!.utilization * 100) : 0;
// Token display: "50k/1M"
const tokenDisplay = `${formatTokens(usedTokens)}/${formatTokens(contextWindowSize)}`;
return (
<Box>
{/* Model name */}
<Text>{shortModel}</Text>
{/* Context usage with token counts */}
<Separator />
<Text dimColor>Context </Text>
<Text>{contextUsedPct}%</Text>
{!narrow && <Text dimColor> ({tokenDisplay})</Text>}
{/* 5-hour session rate limit */}
{hasFiveHour && (
<>
<Separator />
<Text dimColor>Session </Text>
{wide && (
<>
<ProgressBar
ratio={rateLimits.five_hour!.utilization}
width={10}
fillColor="rate_limit_fill"
emptyColor="rate_limit_empty"
/>
<Text> </Text>
</>
)}
<Text>{fiveHourPct}%</Text>
{!narrow && rateLimits.five_hour!.resets_at > 0 && (
<Text dimColor> {formatCountdown(rateLimits.five_hour!.resets_at)}</Text>
)}
</>
)}
{/* 7-day weekly rate limit */}
{hasSevenDay && (
<>
<Separator />
<Text dimColor>Weekly </Text>
{wide && (
<>
<ProgressBar
ratio={rateLimits.seven_day!.utilization}
width={10}
fillColor="rate_limit_fill"
emptyColor="rate_limit_empty"
/>
<Text> </Text>
</>
)}
<Text>{sevenDayPct}%</Text>
{!narrow && rateLimits.seven_day!.resets_at > 0 && (
<Text dimColor> {formatCountdown(rateLimits.seven_day!.resets_at)}</Text>
)}
</>
)}
{/* Cost */}
{totalCostUsd > 0 && (
<>
<Separator />
<Text>{formatCost(totalCostUsd)}</Text>
</>
)}
</Box>
);
}
export const BuiltinStatusLine = React.memo(BuiltinStatusLineInner);

View File

@@ -11,12 +11,12 @@ import { getSSLErrorHint } from '@ant/model-provider';
import { sendNotification } from '../services/notifier.js'; import { sendNotification } from '../services/notifier.js';
import { OAuthService } from '../services/oauth/index.js'; import { OAuthService } from '../services/oauth/index.js';
import { getOauthAccountInfo, validateForceLoginOrg } from '../utils/auth.js'; import { getOauthAccountInfo, validateForceLoginOrg } from '../utils/auth.js';
import { logError } from '../utils/log.js'; import { logError } from '../utils/log.js';
import { getSettings_DEPRECATED, updateSettingsForSource } from '../utils/settings/settings.js'; import { getSettings_DEPRECATED, updateSettingsForSource } from '../utils/settings/settings.js';
import { Select } from './CustomSelect/select.js'; import { Select } from './CustomSelect/select.js';
import { Spinner } from './Spinner.js'; import { Spinner } from './Spinner.js';
import TextInput from './TextInput.js'; import TextInput from './TextInput.js';
import { fi } from 'zod/v4/locales';
type Props = { type Props = {
onDone(): void; onDone(): void;
@@ -596,7 +596,7 @@ function OAuthStatusMessage({
[activeField, baseUrl, apiKey, haikuModel, sonnetModel, opusModel], [activeField, baseUrl, apiKey, haikuModel, sonnetModel, opusModel],
); );
const switchTo = useCallback( const _switchTo = useCallback(
(target: Field) => { (target: Field) => {
setOAuthStatus(buildState(activeField, inputValue, target)); setOAuthStatus(buildState(activeField, inputValue, target));
setInputValue(displayValues[target] ?? ''); setInputValue(displayValues[target] ?? '');

View File

@@ -12,7 +12,7 @@ type Props = {
}; };
export function FileEditToolUpdatedMessage({ export function FileEditToolUpdatedMessage({
filePath, filePath: _filePath,
structuredPatch, structuredPatch,
style, style,
verbose, verbose,

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { type ReactNode, useEffect } from 'react'; import { type ReactNode, useEffect } from 'react';
import { useMainLoopModel } from '../../hooks/useMainLoopModel.js'; import { useMainLoopModel } from '../../hooks/useMainLoopModel.js';
import { useTerminalSize } from '../../hooks/useTerminalSize.js'; import { useTerminalSize } from '../../hooks/useTerminalSize.js';

View File

@@ -63,7 +63,6 @@ import {
incrementOverageCreditUpsellSeenCount, incrementOverageCreditUpsellSeenCount,
createOverageCreditFeed, createOverageCreditFeed,
} from './OverageCreditUpsell.js'; } from './OverageCreditUpsell.js';
import { plural } from '../../utils/stringUtils.js';
import { useAppState } from '../../state/AppState.js'; import { useAppState } from '../../state/AppState.js';
import { getEffortSuffix } from '../../utils/effort.js'; import { getEffortSuffix } from '../../utils/effort.js';
import { useMainLoopModel } from '../../hooks/useMainLoopModel.js'; import { useMainLoopModel } from '../../hooks/useMainLoopModel.js';

View File

@@ -1,6 +1,5 @@
import figures from 'figures'; import figures from 'figures';
import { homedir } from 'os'; import { homedir } from 'os';
import * as React from 'react';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import type { Step } from '../../projectOnboardingState.js'; import type { Step } from '../../projectOnboardingState.js';
import { formatCreditAmount, getCachedReferrerReward } from '../../services/api/referral.js'; import { formatCreditAmount, getCachedReferrerReward } from '../../services/api/referral.js';

View File

@@ -111,7 +111,7 @@ export function Onboarding({ onDone }: Props): React.ReactNode {
</Box> </Box>
); );
const preflightStep = <PreflightStep onSuccess={goToNextStep} />; const _preflightStep = <PreflightStep onSuccess={goToNextStep} />;
// Create the steps array - determine which steps to include based on reAuth and oauthEnabled // Create the steps array - determine which steps to include based on reAuth and oauthEnabled
const apiKeyNeedingApproval = useMemo(() => { const apiKeyNeedingApproval = useMemo(() => {
// Add API key step if needed // Add API key step if needed

View File

@@ -24,7 +24,6 @@ import { setEnvHookNotifier } from '../../utils/hooks/fileChangedWatcher.js';
import { toIDEDisplayName } from '../../utils/ide.js'; import { toIDEDisplayName } from '../../utils/ide.js';
import { getMessagesAfterCompactBoundary } from '../../utils/messages.js'; import { getMessagesAfterCompactBoundary } from '../../utils/messages.js';
import { tokenCountFromLastAPIResponse } from '../../utils/tokens.js'; import { tokenCountFromLastAPIResponse } from '../../utils/tokens.js';
import { AutoUpdaterWrapper } from '../AutoUpdaterWrapper.js';
import { ConfigurableShortcutHint } from '../ConfigurableShortcutHint.js'; import { ConfigurableShortcutHint } from '../ConfigurableShortcutHint.js';
import { IdeStatusIndicator } from '../IdeStatusIndicator.js'; import { IdeStatusIndicator } from '../IdeStatusIndicator.js';
import { MemoryUsageIndicator } from '../MemoryUsageIndicator.js'; import { MemoryUsageIndicator } from '../MemoryUsageIndicator.js';
@@ -57,13 +56,13 @@ type Props = {
export function Notifications({ export function Notifications({
apiKeyStatus, apiKeyStatus,
autoUpdaterResult, autoUpdaterResult: _autoUpdaterResult,
debug, debug,
isAutoUpdating, isAutoUpdating: _isAutoUpdating,
verbose, verbose,
messages, messages,
onAutoUpdaterResult, onAutoUpdaterResult: _onAutoUpdaterResult,
onChangeIsUpdating, onChangeIsUpdating: _onChangeIsUpdating,
ideSelection, ideSelection,
mcpClients, mcpClients,
isInputWrapped = false, isInputWrapped = false,
@@ -102,9 +101,6 @@ export function Notifications({
const shouldShowIdeSelection = const shouldShowIdeSelection =
ideStatus === 'connected' && (ideSelection?.filePath || (ideSelection?.text && ideSelection.lineCount > 0)); ideStatus === 'connected' && (ideSelection?.filePath || (ideSelection?.text && ideSelection.lineCount > 0));
// Hide update installed message when showing IDE selection
const shouldShowAutoUpdater = !shouldShowIdeSelection || isAutoUpdating || autoUpdaterResult?.status !== 'success';
// Check if we're in overage mode for UI indicators // Check if we're in overage mode for UI indicators
const isInOverageMode = claudeAiLimits.isUsingOverage; const isInOverageMode = claudeAiLimits.isUsingOverage;
const subscriptionType = getSubscriptionType(); const subscriptionType = getSubscriptionType();
@@ -157,12 +153,6 @@ export function Notifications({
verbose={verbose} verbose={verbose}
tokenUsage={tokenUsage} tokenUsage={tokenUsage}
mainLoopModel={mainLoopModel} mainLoopModel={mainLoopModel}
shouldShowAutoUpdater={shouldShowAutoUpdater}
autoUpdaterResult={autoUpdaterResult}
isAutoUpdating={isAutoUpdating}
isShowingCompactMessage={isShowingCompactMessage}
onAutoUpdaterResult={onAutoUpdaterResult}
onChangeIsUpdating={onChangeIsUpdating}
/> />
</Box> </Box>
</SentryErrorBoundary> </SentryErrorBoundary>
@@ -180,12 +170,6 @@ function NotificationContent({
verbose, verbose,
tokenUsage, tokenUsage,
mainLoopModel, mainLoopModel,
shouldShowAutoUpdater,
autoUpdaterResult,
isAutoUpdating,
isShowingCompactMessage,
onAutoUpdaterResult,
onChangeIsUpdating,
}: { }: {
ideSelection: IDESelection | undefined; ideSelection: IDESelection | undefined;
mcpClients?: MCPServerConnection[]; mcpClients?: MCPServerConnection[];
@@ -200,12 +184,6 @@ function NotificationContent({
verbose: boolean; verbose: boolean;
tokenUsage: number; tokenUsage: number;
mainLoopModel: string; mainLoopModel: string;
shouldShowAutoUpdater: boolean;
autoUpdaterResult: AutoUpdaterResult | null;
isAutoUpdating: boolean;
isShowingCompactMessage: boolean;
onAutoUpdaterResult: (result: AutoUpdaterResult) => void;
onChangeIsUpdating: (isUpdating: boolean) => void;
}): ReactNode { }): ReactNode {
// Poll apiKeyHelper inflight state to show slow-helper notice. // Poll apiKeyHelper inflight state to show slow-helper notice.
// Gated on configuration — most users never set apiKeyHelper, so the // Gated on configuration — most users never set apiKeyHelper, so the

View File

@@ -55,7 +55,6 @@ import {
} from '@claude-code-best/builtin-tools/tools/AgentTool/agentColorManager.js'; } from '@claude-code-best/builtin-tools/tools/AgentTool/agentColorManager.js';
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'; import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js';
import type { Message } from '../../types/message.js'; import type { Message } from '../../types/message.js';
import type { PermissionMode } from '../../types/permissions.js';
import type { BaseTextInputProps, PromptInputMode, VimMode } from '../../types/textInputTypes.js'; import type { BaseTextInputProps, PromptInputMode, VimMode } from '../../types/textInputTypes.js';
import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js'; import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js';
import { count } from '../../utils/array.js'; import { count } from '../../utils/array.js';
@@ -329,7 +328,7 @@ function PromptInput({
const hasTungstenSession = useAppState(s => process.env.USER_TYPE === 'ant' && s.tungstenActiveSession !== undefined); const hasTungstenSession = useAppState(s => process.env.USER_TYPE === 'ant' && s.tungstenActiveSession !== undefined);
const tmuxFooterVisible = process.env.USER_TYPE === 'ant' && hasTungstenSession; const tmuxFooterVisible = process.env.USER_TYPE === 'ant' && hasTungstenSession;
// WebBrowser pill — visible when a browser is open // WebBrowser pill — visible when a browser is open
const bagelFooterVisible = useAppState(s => false); const bagelFooterVisible = useAppState(_s => false);
const teamContext = useAppState(s => s.teamContext); const teamContext = useAppState(s => s.teamContext);
const queuedCommands = useCommandQueue(); const queuedCommands = useCommandQueue();
const promptSuggestionState = useAppState(s => s.promptSuggestion); const promptSuggestionState = useAppState(s => s.promptSuggestion);
@@ -538,7 +537,7 @@ function PromptInput({
const tasksSelected = footerItemSelected === 'tasks'; const tasksSelected = footerItemSelected === 'tasks';
const tmuxSelected = footerItemSelected === 'tmux'; const tmuxSelected = footerItemSelected === 'tmux';
const bagelSelected = footerItemSelected === 'bagel'; const _bagelSelected = footerItemSelected === 'bagel';
const teamsSelected = footerItemSelected === 'teams'; const teamsSelected = footerItemSelected === 'teams';
const bridgeSelected = footerItemSelected === 'bridge'; const bridgeSelected = footerItemSelected === 'bridge';

View File

@@ -1,6 +1,6 @@
import { feature } from 'bun:bundle'; import { feature } from 'bun:bundle';
import * as React from 'react'; import * as React from 'react';
import { memo, type ReactNode, useCallback, useMemo, useRef, useState } from 'react'; import { memo, type ReactNode, useMemo, useRef, useState } from 'react';
import { isBridgeEnabled } from '../../bridge/bridgeEnabled.js'; import { isBridgeEnabled } from '../../bridge/bridgeEnabled.js';
import { getBridgeStatus } from '../../bridge/bridgeStatusUtil.js'; import { getBridgeStatus } from '../../bridge/bridgeStatusUtil.js';
import { useSetPromptOverlay } from '../../context/promptOverlayContext.js'; import { useSetPromptOverlay } from '../../context/promptOverlayContext.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { memo, type ReactNode } from 'react'; import { memo, type ReactNode } from 'react';
import { useTerminalSize } from '../../hooks/useTerminalSize.js'; import { useTerminalSize } from '../../hooks/useTerminalSize.js';
import { Box, Text, stringWidth } from '@anthropic/ink'; import { Box, Text, stringWidth } from '@anthropic/ink';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { type ReactNode, useEffect, useRef, useState } from 'react'; import { type ReactNode, useEffect, useRef, useState } from 'react';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import { useShortcutDisplay } from '../../keybindings/useShortcutDisplay.js'; import { useShortcutDisplay } from '../../keybindings/useShortcutDisplay.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { type ReactNode, useEffect, useState } from 'react'; import { type ReactNode, useEffect, useState } from 'react';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import type { SandboxViolationEvent } from '../utils/sandbox/sandbox-adapter.js'; import type { SandboxViolationEvent } from '../utils/sandbox/sandbox-adapter.js';

View File

@@ -15,14 +15,11 @@ import {
} from '../../utils/config.js'; } from '../../utils/config.js';
import chalk from 'chalk'; import chalk from 'chalk';
import { import {
permissionModeTitle,
permissionModeShortTitle, permissionModeShortTitle,
permissionModeFromString, permissionModeFromString,
toExternalPermissionMode, toExternalPermissionMode,
isExternalPermissionMode, isExternalPermissionMode,
EXTERNAL_PERMISSION_MODES,
PERMISSION_MODES, PERMISSION_MODES,
type ExternalPermissionMode,
type PermissionMode, type PermissionMode,
} from '../../utils/permissions/PermissionMode.js'; } from '../../utils/permissions/PermissionMode.js';
import { import {

View File

@@ -9,7 +9,7 @@ import { getFeatureValue_CACHED_MAY_BE_STALE } from '../services/analytics/growt
import { isEnvTruthy } from '../utils/envUtils.js'; import { isEnvTruthy } from '../utils/envUtils.js';
import { count } from '../utils/array.js'; import { count } from '../utils/array.js';
import sample from 'lodash-es/sample.js'; import sample from 'lodash-es/sample.js';
import { formatDuration, formatNumber, formatSecondsShort } from '../utils/format.js'; import { formatDuration, formatNumber } from '../utils/format.js';
import type { Theme } from 'src/utils/theme.js'; import type { Theme } from 'src/utils/theme.js';
import { activityManager } from '../utils/activityManager.js'; import { activityManager } from '../utils/activityManager.js';
import { getSpinnerVerbs } from '../constants/spinnerVerbs.js'; import { getSpinnerVerbs } from '../constants/spinnerVerbs.js';
@@ -244,7 +244,7 @@ function SpinnerWithVerbInner({
// TTFT display is gated to internal builds — apiMetricsRef was removed from // TTFT display is gated to internal builds — apiMetricsRef was removed from
// props during a refactor, so skip this until it's re-threaded. // props during a refactor, so skip this until it's re-threaded.
let ttftText: string | null = null; const _ttftText: string | null = null;
// When leader is idle but teammates are running (and we're viewing the leader), // When leader is idle but teammates are running (and we're viewing the leader),
// show a static dim idle display instead of the animated spinner — otherwise // show a static dim idle display instead of the animated spinner — otherwise

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { isAutoMemoryEnabled } from '../../../memdir/paths.js'; import { isAutoMemoryEnabled } from '../../../memdir/paths.js';
import type { Tools } from '../../../Tool.js'; import type { Tools } from '../../../Tool.js';
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'; import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'; import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink';
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
import type { AgentColorName } from '@claude-code-best/builtin-tools/tools/AgentTool/agentColorManager.js'; import type { AgentColorName } from '@claude-code-best/builtin-tools/tools/AgentTool/agentColorManager.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { type KeyboardEvent, Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'; import { type KeyboardEvent, Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink';
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
import { isAutoMemoryEnabled } from '../../../../memdir/paths.js'; import { isAutoMemoryEnabled } from '../../../../memdir/paths.js';

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk'; import chalk from 'chalk';
import React, { type ReactNode, useCallback, useState } from 'react'; import { type ReactNode, useCallback, useState } from 'react';
import { import {
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
logEvent, logEvent,

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode, useCallback, useState } from 'react'; import { type ReactNode, useCallback, useState } from 'react';
import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'; import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink';
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
import { editPromptInEditor } from '../../../../utils/promptEditor.js'; import { editPromptInEditor } from '../../../../utils/promptEditor.js';

View File

@@ -1,5 +1,5 @@
import { APIUserAbortError } from '@anthropic-ai/sdk'; import { APIUserAbortError } from '@anthropic-ai/sdk';
import React, { type ReactNode, useCallback, useRef, useState } from 'react'; import { type ReactNode, useCallback, useRef, useState } from 'react';
import { useMainLoopModel } from '../../../../hooks/useMainLoopModel.js'; import { useMainLoopModel } from '../../../../hooks/useMainLoopModel.js';
import { Box, Byline, Text } from '@anthropic/ink'; import { Box, Byline, Text } from '@anthropic/ink';
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../../../keybindings/useKeybinding.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'; import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink';
import type { SettingSource } from '../../../../utils/settings/constants.js'; import type { SettingSource } from '../../../../utils/settings/constants.js';
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'; import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'; import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink';
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
import { isAutoMemoryEnabled } from '../../../../memdir/paths.js'; import { isAutoMemoryEnabled } from '../../../../memdir/paths.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'; import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink';
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'; import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js';
import { Select } from '../../../CustomSelect/select.js'; import { Select } from '../../../CustomSelect/select.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'; import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js';
import { Byline, KeyboardShortcutHint } from '@anthropic/ink'; import { Byline, KeyboardShortcutHint } from '@anthropic/ink';
import { useWizard } from '../../../wizard/index.js'; import { useWizard } from '../../../wizard/index.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode, useCallback, useState } from 'react'; import { type ReactNode, useCallback, useState } from 'react';
import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'; import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink';
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
import { editPromptInEditor } from '../../../../utils/promptEditor.js'; import { editPromptInEditor } from '../../../../utils/promptEditor.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import type { Tools } from '../../../../Tool.js'; import type { Tools } from '../../../../Tool.js';
import { Byline, KeyboardShortcutHint } from '@anthropic/ink'; import { Byline, KeyboardShortcutHint } from '@anthropic/ink';
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'; import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode, useState } from 'react'; import { type ReactNode, useState } from 'react';
import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'; import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink';
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'; import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'; import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js';

View File

@@ -1,4 +0,0 @@
// Auto-generated stub — replace with real implementation
export {}
export const SnipBoundaryMessage: (props: Record<string, unknown>) => null =
() => null

View File

@@ -1,4 +0,0 @@
// Auto-generated stub — replace with real implementation
export {}
export const UserCrossSessionMessage: (props: Record<string, unknown>) => null =
() => null

View File

@@ -1,5 +0,0 @@
// Auto-generated stub — replace with real implementation
export {}
export const UserForkBoilerplateMessage: (
props: Record<string, unknown>,
) => null = () => null

View File

@@ -1,5 +0,0 @@
// Auto-generated stub — replace with real implementation
export {}
export const UserGitHubWebhookMessage: (
props: Record<string, unknown>,
) => null = () => null

View File

@@ -1,6 +1,6 @@
import { homedir } from 'os'; import { homedir } from 'os';
import { basename, join, sep } from 'path'; import { basename, join, sep } from 'path';
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { getOriginalCwd } from '../../../bootstrap/state.js'; import { getOriginalCwd } from '../../../bootstrap/state.js';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';
import { getShortcutDisplay } from '../../../keybindings/shortcutFormat.js'; import { getShortcutDisplay } from '../../../keybindings/shortcutFormat.js';

View File

@@ -1,5 +1,5 @@
import { basename, sep } from 'path'; import { basename, sep } from 'path';
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { getOriginalCwd } from '../../bootstrap/state.js'; import { getOriginalCwd } from '../../bootstrap/state.js';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';
import type { PermissionUpdate } from '../../utils/permissions/PermissionUpdateSchema.js'; import type { PermissionUpdate } from '../../utils/permissions/PermissionUpdateSchema.js';

View File

@@ -1,5 +1,4 @@
import type { ReactNode } from 'react'; import type { ReactNode } from 'react';
import React from 'react';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';
import type { TaskStatus } from 'src/Task.js'; import type { TaskStatus } from 'src/Task.js';
import type { LocalShellTaskState } from 'src/tasks/LocalShellTask/guards.js'; import type { LocalShellTaskState } from 'src/tasks/LocalShellTask/guards.js';

View File

@@ -24,7 +24,7 @@ type Props = {
*/ */
export function WorkflowDetailDialog({ export function WorkflowDetailDialog({
workflow, workflow,
onDone, onDone: _onDone,
onKill, onKill,
onSkipAgent: _onSkipAgent, onSkipAgent: _onSkipAgent,
onRetryAgent: _onRetryAgent, onRetryAgent: _onRetryAgent,

View File

@@ -26,13 +26,7 @@ import { IT2_COMMAND, isInsideTmuxSync } from '../../utils/swarm/backends/detect
import { ensureBackendsRegistered, getBackendByType, getCachedBackend } from '../../utils/swarm/backends/registry.js'; import { ensureBackendsRegistered, getBackendByType, getCachedBackend } from '../../utils/swarm/backends/registry.js';
import { isPaneBackend, type PaneBackendType } from '../../utils/swarm/backends/types.js'; import { isPaneBackend, type PaneBackendType } from '../../utils/swarm/backends/types.js';
import { getSwarmSocketName, TMUX_COMMAND } from '../../utils/swarm/constants.js'; import { getSwarmSocketName, TMUX_COMMAND } from '../../utils/swarm/constants.js';
import { import { removeMemberFromTeam, setMemberMode, setMultipleMemberModes } from '../../utils/swarm/teamHelpers.js';
addHiddenPaneId,
removeHiddenPaneId,
removeMemberFromTeam,
setMemberMode,
setMultipleMemberModes,
} from '../../utils/swarm/teamHelpers.js';
import { listTasks, type Task, unassignTeammateTasks } from '../../utils/tasks.js'; import { listTasks, type Task, unassignTeammateTasks } from '../../utils/tasks.js';
import { getTeammateStatuses, type TeammateStatus, type TeamSummary } from '../../utils/teamDiscovery.js'; import { getTeammateStatuses, type TeammateStatus, type TeamSummary } from '../../utils/teamDiscovery.js';
import { import {
@@ -560,13 +554,13 @@ async function toggleTeammateVisibility(teammate: TeammateStatus, teamName: stri
* Hide a teammate pane using the backend abstraction. * Hide a teammate pane using the backend abstraction.
* Only available for ant users (gated for dead code elimination in external builds) * Only available for ant users (gated for dead code elimination in external builds)
*/ */
async function hideTeammate(teammate: TeammateStatus, teamName: string): Promise<void> {} async function hideTeammate(_teammate: TeammateStatus, _teamName: string): Promise<void> {}
/** /**
* Show a previously hidden teammate pane using the backend abstraction. * Show a previously hidden teammate pane using the backend abstraction.
* Only available for ant users (gated for dead code elimination in external builds) * Only available for ant users (gated for dead code elimination in external builds)
*/ */
async function showTeammate(teammate: TeammateStatus, teamName: string): Promise<void> {} async function showTeammate(_teammate: TeammateStatus, _teamName: string): Promise<void> {}
/** /**
* Send a mode change message to a single teammate * Send a mode change message to a single teammate

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import type { Theme } from '../../utils/theme.js'; import type { Theme } from '../../utils/theme.js';
import { Dialog } from '@anthropic/ink'; import { Dialog } from '@anthropic/ink';
import { useWizard } from './useWizard.js'; import { useWizard } from './useWizard.js';

View File

@@ -1,4 +1,4 @@
import React, { type ReactNode } from 'react'; import { type ReactNode } from 'react';
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'; import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js';
import { Box, Text } from '@anthropic/ink'; import { Box, Text } from '@anthropic/ink';
import { ConfigurableShortcutHint } from '../ConfigurableShortcutHint.js'; import { ConfigurableShortcutHint } from '../ConfigurableShortcutHint.js';

View File

@@ -1,4 +1,4 @@
import React, { createContext, type ReactNode, useCallback, useEffect, useMemo, useState } from 'react'; import { createContext, type ReactNode, useCallback, useEffect, useMemo, useState } from 'react';
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'; import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js';
import type { WizardContextValue, WizardProviderProps } from './types.js'; import type { WizardContextValue, WizardProviderProps } from './types.js';

View File

@@ -18,7 +18,7 @@
* Split into data/setter context pairs so writers never re-render on * Split into data/setter context pairs so writers never re-render on
* their own writes — the setter contexts are stable. * their own writes — the setter contexts are stable.
*/ */
import React, { createContext, type ReactNode, useContext, useEffect, useState } from 'react'; import { createContext, type ReactNode, useContext, useEffect, useState } from 'react';
import type { SuggestionItem } from '../components/PromptInput/PromptInputFooterSuggestions.js'; import type { SuggestionItem } from '../components/PromptInput/PromptInputFooterSuggestions.js';
export type PromptOverlayData = { export type PromptOverlayData = {

View File

@@ -1,7 +1,6 @@
import { type ChildProcess } from 'child_process' import { type ChildProcess } from 'child_process'
import { resolve } from 'path' import { resolve } from 'path'
import { buildCliLaunch, spawnCli } from '../utils/cliLaunch.js' import { buildCliLaunch, spawnCli } from '../utils/cliLaunch.js'
import { errorMessage } from '../utils/errors.js'
import { import {
writeDaemonState, writeDaemonState,
removeDaemonState, removeDaemonState,

View File

@@ -1,4 +1,8 @@
#!/usr/bin/env bun #!/usr/bin/env bun
// Performance shim MUST be the first import — it replaces globalThis.performance
// with a JS-backed implementation before React/OTel capture the native reference.
// Without this, JSC's C++ Vector grows without bound in long-running sessions.
import '../utils/performanceShim.js';
import { feature } from 'bun:bundle'; import { feature } from 'bun:bundle';
import { isEnvTruthy } from '../utils/envUtils.js'; import { isEnvTruthy } from '../utils/envUtils.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { getOauthProfileFromApiKey } from 'src/services/oauth/getOauthProfile.js'; import { getOauthProfileFromApiKey } from 'src/services/oauth/getOauthProfile.js';
import { isClaudeAISubscriber } from 'src/utils/auth.js'; import { isClaudeAISubscriber } from 'src/utils/auth.js';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useRef } from 'react'; import { useEffect, useRef } from 'react';
import { useNotifications } from 'src/context/notifications.js'; import { useNotifications } from 'src/context/notifications.js';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';
import type { MCPServerConnection } from 'src/services/mcp/types.js'; import type { MCPServerConnection } from 'src/services/mcp/types.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { useNotifications } from 'src/context/notifications.js'; import { useNotifications } from 'src/context/notifications.js';
import { getIsRemoteMode } from '../../bootstrap/state.js'; import { getIsRemoteMode } from '../../bootstrap/state.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { getIsRemoteMode } from '../../bootstrap/state.js'; import { getIsRemoteMode } from '../../bootstrap/state.js';
import { useNotifications } from '../../context/notifications.js'; import { useNotifications } from '../../context/notifications.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { useEffect, useMemo } from 'react'; import { useEffect, useMemo } from 'react';
import { getIsRemoteMode } from '../../bootstrap/state.js'; import { getIsRemoteMode } from '../../bootstrap/state.js';
import { useNotifications } from '../../context/notifications.js'; import { useNotifications } from '../../context/notifications.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { useEffect, useMemo, useRef, useState } from 'react'; import { useEffect, useMemo, useRef, useState } from 'react';
import { useNotifications } from 'src/context/notifications.js'; import { useNotifications } from 'src/context/notifications.js';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useRef, useState } from 'react'; import { useCallback, useRef, useState } from 'react';
import { getModeFromInput } from 'src/components/PromptInput/inputModes.js'; import { getModeFromInput } from 'src/components/PromptInput/inputModes.js';
import { useNotifications } from 'src/context/notifications.js'; import { useNotifications } from 'src/context/notifications.js';
import { ConfigurableShortcutHint } from '../components/ConfigurableShortcutHint.js'; import { ConfigurableShortcutHint } from '../components/ConfigurableShortcutHint.js';

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';
import { isClaudeAISubscriber } from '../utils/auth.js'; import { isClaudeAISubscriber } from '../utils/auth.js';
import { isChromeExtensionInstalled, shouldEnableClaudeInChrome } from '../utils/claudeInChrome/setup.js'; import { isChromeExtensionInstalled, shouldEnableClaudeInChrome } from '../utils/claudeInChrome/setup.js';

View File

@@ -2,7 +2,6 @@
import { useMemo } from 'react' import { useMemo } from 'react'
import type { Tools, ToolPermissionContext } from '../Tool.js' import type { Tools, ToolPermissionContext } from '../Tool.js'
import { assembleToolPool } from '../tools.js' import { assembleToolPool } from '../tools.js'
import { useAppState } from '../state/AppState.js'
import { mergeAndFilterTools } from '../utils/toolPool.js' import { mergeAndFilterTools } from '../utils/toolPool.js'
/** /**

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import type { Notification } from '../context/notifications.js'; import type { Notification } from '../context/notifications.js';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';
import { logForDebugging } from '../utils/debug.js'; import { logForDebugging } from '../utils/debug.js';

View File

@@ -21,10 +21,7 @@ import {
isSessionEndMessage, isSessionEndMessage,
} from '../remote/sdkMessageAdapter.js' } from '../remote/sdkMessageAdapter.js'
import type { SSHSession } from '../ssh/createSSHSession.js' import type { SSHSession } from '../ssh/createSSHSession.js'
import type { import type { SSHSessionManager } from '../ssh/SSHSessionManager.js'
SSHSessionManager,
SSHPermissionRequest,
} from '../ssh/SSHSessionManager.js'
import type { Tool } from '../Tool.js' import type { Tool } from '../Tool.js'
import { findToolByName } from '../Tool.js' import { findToolByName } from '../Tool.js'
import type { Message as MessageType } from '../types/message.js' import type { Message as MessageType } from '../types/message.js'

View File

@@ -1,4 +1,3 @@
import * as React from 'react';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useNotifications } from 'src/context/notifications.js'; import { useNotifications } from 'src/context/notifications.js';
import { Text } from '@anthropic/ink'; import { Text } from '@anthropic/ink';

View File

@@ -19,11 +19,7 @@ import { isSynchronizedOutputSupported } from '@anthropic/ink';
import type { RenderOptions, Root, TextProps } from '@anthropic/ink'; import type { RenderOptions, Root, TextProps } from '@anthropic/ink';
import { KeybindingSetup } from './keybindings/KeybindingProviderSetup.js'; import { KeybindingSetup } from './keybindings/KeybindingProviderSetup.js';
import { startDeferredPrefetches } from './main.js'; import { startDeferredPrefetches } from './main.js';
import { import { initializeGrowthBook, resetGrowthBook } from './services/analytics/growthbook.js';
checkGate_CACHED_OR_BLOCKING,
initializeGrowthBook,
resetGrowthBook,
} from './services/analytics/growthbook.js';
import { isQualifiedForGrove } from './services/api/grove.js'; import { isQualifiedForGrove } from './services/api/grove.js';
import { handleMcpjsonServerApprovals } from './services/mcpServerApproval.js'; import { handleMcpjsonServerApprovals } from './services/mcpServerApproval.js';
import { AppStateProvider } from './state/AppState.js'; import { AppStateProvider } from './state/AppState.js';

View File

@@ -28,7 +28,6 @@ import { readFileSync } from 'fs';
import mapValues from 'lodash-es/mapValues.js'; import mapValues from 'lodash-es/mapValues.js';
import pickBy from 'lodash-es/pickBy.js'; import pickBy from 'lodash-es/pickBy.js';
import uniqBy from 'lodash-es/uniqBy.js'; import uniqBy from 'lodash-es/uniqBy.js';
import React from 'react';
import { getOauthConfig } from './constants/oauth.js'; import { getOauthConfig } from './constants/oauth.js';
import { getRemoteSessionUrl } from './constants/product.js'; import { getRemoteSessionUrl } from './constants/product.js';
import { getSystemContext, getUserContext } from './context.js'; import { getSystemContext, getUserContext } from './context.js';
@@ -383,7 +382,7 @@ function logManagedSettings(): void {
} }
// Check if running in debug/inspection mode // Check if running in debug/inspection mode
function isBeingDebugged() { function _isBeingDebugged() {
const isBun = isRunningWithBun(); const isBun = isRunningWithBun();
// Check for inspect flags in process arguments (including all variants) // Check for inspect flags in process arguments (including all variants)

View File

@@ -8,7 +8,6 @@ import { FallbackTriggeredError } from './services/api/withRetry.js'
import { import {
calculateTokenWarningState, calculateTokenWarningState,
estimateMaxTurnGrowth, estimateMaxTurnGrowth,
getAutoCompactThreshold,
getEffectiveContextWindowSize, getEffectiveContextWindowSize,
isAutoCompactEnabled, isAutoCompactEnabled,
type AutoCompactTrackingState, type AutoCompactTrackingState,
@@ -69,7 +68,7 @@ import {
const skillPrefetch = feature('EXPERIMENTAL_SKILL_SEARCH') const skillPrefetch = feature('EXPERIMENTAL_SKILL_SEARCH')
? (require('./services/skillSearch/prefetch.js') as typeof import('./services/skillSearch/prefetch.js')) ? (require('./services/skillSearch/prefetch.js') as typeof import('./services/skillSearch/prefetch.js'))
: null : null
const jobClassifier = feature('TEMPLATES') const _jobClassifier = feature('TEMPLATES')
? (require('./jobs/classifier.js') as typeof import('./jobs/classifier.js')) ? (require('./jobs/classifier.js') as typeof import('./jobs/classifier.js'))
: null : null
/* eslint-enable @typescript-eslint/no-require-imports */ /* eslint-enable @typescript-eslint/no-require-imports */
@@ -124,6 +123,7 @@ import { count } from './utils/array.js'
import { import {
createTrace, createTrace,
endTrace, endTrace,
flushLangfuse,
isLangfuseEnabled, isLangfuseEnabled,
} from './services/langfuse/index.js' } from './services/langfuse/index.js'
import { getAPIProvider } from './utils/model/providers.js' import { getAPIProvider } from './utils/model/providers.js'
@@ -339,6 +339,11 @@ export async function* query(
terminal?.reason === 'aborted_streaming' || terminal?.reason === 'aborted_streaming' ||
terminal?.reason === 'aborted_tools' terminal?.reason === 'aborted_tools'
endTrace(langfuseTrace, undefined, isAborted ? 'interrupted' : undefined) endTrace(langfuseTrace, undefined, isAborted ? 'interrupted' : undefined)
// Flush the processor to release span data (including serialized
// conversation history stored as langfuse.observation.input). Without
// this, SpanImpl objects retain hundreds of KB of JSON until the
// processor's batch timer fires (default 10s).
await flushLangfuse()
} }
// Break the closure chain: toolUseContext captures langfuseTrace which // Break the closure chain: toolUseContext captures langfuseTrace which
@@ -349,6 +354,21 @@ export async function* query(
paramsWithTrace.toolUseContext.langfuseRootTrace = null paramsWithTrace.toolUseContext.langfuseRootTrace = null
paramsWithTrace.toolUseContext.langfuseBatchSpan = null paramsWithTrace.toolUseContext.langfuseBatchSpan = null
} }
// Clear JSC's native Performance buffers. OTel (otperformance) references
// globalThis.performance which stores marks/measures/resource timings in a
// C++ Vector that never shrinks. Long-running sessions accumulate hundreds
// of MB of dead capacity even after spans are flushed and nullified.
const gPerf = globalThis.performance
if (gPerf && typeof gPerf.clearMarks === 'function') {
try {
gPerf.clearMarks()
gPerf.clearMeasures?.()
gPerf.clearResourceTimings?.()
} catch {
// Non-critical — some environments may not support all methods
}
}
} }
// Only reached if queryLoop returned normally. Skipped on throw (error // Only reached if queryLoop returned normally. Skipped on throw (error

View File

@@ -270,7 +270,7 @@ import { useManagePlugins } from '../hooks/useManagePlugins.js';
import { Messages } from '../components/Messages.js'; import { Messages } from '../components/Messages.js';
import { TaskListV2 } from '../components/TaskListV2.js'; import { TaskListV2 } from '../components/TaskListV2.js';
import { TeammateViewHeader } from '../components/TeammateViewHeader.js'; import { TeammateViewHeader } from '../components/TeammateViewHeader.js';
import { getPipeDisplayRole, getPipeIpc, isPipeControlled } from '../utils/pipeTransport.js'; import { getPipeIpc } from '../utils/pipeTransport.js';
import { useTasksV2WithCollapseEffect } from '../hooks/useTasksV2.js'; import { useTasksV2WithCollapseEffect } from '../hooks/useTasksV2.js';
import { maybeMarkProjectOnboardingComplete } from '../projectOnboardingState.js'; import { maybeMarkProjectOnboardingComplete } from '../projectOnboardingState.js';
import type { MCPServerConnection } from '../services/mcp/types.js'; import type { MCPServerConnection } from '../services/mcp/types.js';
@@ -808,8 +808,8 @@ export function REPL({
pendingHookMessages, pendingHookMessages,
initialFileHistorySnapshots, initialFileHistorySnapshots,
initialContentReplacements, initialContentReplacements,
initialAgentName, initialAgentName: _initialAgentName,
initialAgentColor, initialAgentColor: _initialAgentColor,
mcpClients: initialMcpClients, mcpClients: initialMcpClients,
dynamicMcpConfig: initialDynamicMcpConfig, dynamicMcpConfig: initialDynamicMcpConfig,
autoConnectIdeFlag, autoConnectIdeFlag,
@@ -2797,7 +2797,7 @@ export function REPL({
const getToolUseContext = useCallback( const getToolUseContext = useCallback(
( (
messages: MessageType[], messages: MessageType[],
newMessages: MessageType[], _newMessages: MessageType[],
abortController: AbortController, abortController: AbortController,
mainLoopModel: string, mainLoopModel: string,
): ProcessUserInputContext => { ): ProcessUserInputContext => {
@@ -4937,7 +4937,7 @@ export function REPL({
useMailboxBridge({ isLoading, onSubmitMessage: handleIncomingPrompt }); useMailboxBridge({ isLoading, onSubmitMessage: handleIncomingPrompt });
useMasterMonitor(); useMasterMonitor();
useSlaveNotifications(); useSlaveNotifications();
const pipeIpcState = useAppState(s => getPipeIpc(s as any)); const _pipeIpcState = useAppState(s => getPipeIpc(s as any));
usePipePermissionForward({ store, tools, setMessages, setToolUseConfirmQueue, getToolUseContext, mainLoopModel }); usePipePermissionForward({ store, tools, setMessages, setToolUseConfirmQueue, getToolUseContext, mainLoopModel });
usePipeMuteSync({ setToolUseConfirmQueue }); usePipeMuteSync({ setToolUseConfirmQueue });

View File

@@ -32,7 +32,7 @@ import { toolInfoFromToolUse } from './bridge.js'
export function createAcpCanUseTool( export function createAcpCanUseTool(
conn: AgentSideConnection, conn: AgentSideConnection,
sessionId: string, sessionId: string,
getCurrentMode: () => string, _getCurrentMode: () => string,
clientCapabilities?: ClientCapabilities, clientCapabilities?: ClientCapabilities,
cwd?: string, cwd?: string,
onModeChange?: (modeId: string) => void, onModeChange?: (modeId: string) => void,

View File

@@ -121,7 +121,6 @@ import {
getAfkModeHeaderLatched, getAfkModeHeaderLatched,
getCacheEditingHeaderLatched, getCacheEditingHeaderLatched,
getFastModeHeaderLatched, getFastModeHeaderLatched,
getLastApiCompletionTimestamp,
getPromptCache1hAllowlist, getPromptCache1hAllowlist,
getPromptCache1hEligible, getPromptCache1hEligible,
getSessionId, getSessionId,
@@ -253,7 +252,6 @@ import {
type NonNullableUsage, type NonNullableUsage,
} from './logging.js' } from './logging.js'
import { import {
CACHE_TTL_1HOUR_MS,
checkResponseForCacheBreak, checkResponseForCacheBreak,
recordPromptState, recordPromptState,
} from './promptCacheBreakDetection.js' } from './promptCacheBreakDetection.js'

View File

@@ -6,7 +6,7 @@ import type {
StreamEvent, StreamEvent,
SystemAPIErrorMessage, SystemAPIErrorMessage,
} from '../../../types/message.js' } from '../../../types/message.js'
import { getEmptyToolPermissionContext, type Tools } from '../../../Tool.js' import { type Tools } from '../../../Tool.js'
import { toolToAPISchema } from '../../../utils/api.js' import { toolToAPISchema } from '../../../utils/api.js'
import { logForDebugging } from '../../../utils/debug.js' import { logForDebugging } from '../../../utils/debug.js'
import { import {

View File

@@ -2,7 +2,6 @@ import OpenAI from 'openai'
import { openaiAdapter } from 'src/services/providerUsage/adapters/openai.js' import { openaiAdapter } from 'src/services/providerUsage/adapters/openai.js'
import { updateProviderBuckets } from 'src/services/providerUsage/store.js' import { updateProviderBuckets } from 'src/services/providerUsage/store.js'
import { getProxyFetchOptions } from 'src/utils/proxy.js' import { getProxyFetchOptions } from 'src/utils/proxy.js'
import { isEnvTruthy } from 'src/utils/envUtils.js'
/** /**
* Environment variables: * Environment variables:

View File

@@ -9,8 +9,6 @@ import type {
} from '../../../types/message.js' } from '../../../types/message.js'
import type { AgentId } from '../../../types/ids.js' import type { AgentId } from '../../../types/ids.js'
import type { Tools } from '../../../Tool.js' import type { Tools } from '../../../Tool.js'
import type { Stream } from 'openai/streaming.mjs'
import type { ChatCompletionCreateParamsStreaming } from 'openai/resources/chat/completions/completions.mjs'
import { getOpenAIClient } from './client.js' import { getOpenAIClient } from './client.js'
import { import {
anthropicMessagesToOpenAI, anthropicMessagesToOpenAI,

View File

@@ -98,7 +98,7 @@ export function getToolResultsToDelete(state: CachedMCState): string[] {
* Returns null if toolIds is empty. * Returns null if toolIds is empty.
*/ */
export function createCacheEditsBlock( export function createCacheEditsBlock(
state: CachedMCState, _state: CachedMCState,
toolIds: string[], toolIds: string[],
): CacheEditsBlock | null { ): CacheEditsBlock | null {
if (toolIds.length === 0) return null if (toolIds.length === 0) return null

Some files were not shown because too many files have changed in this diff Show More