chore: merge fcbc8822 — remove 113 unused imports and dead code
- 95 files modified (307 deletions, 92 insertions)
- Removed unused React imports from ~55 components
- Cleaned ~50 unused imports/variables/parameters
- 10 files skipped (version drift, CCP structure differences)
Source: upstream CCB fcbc8822
Note: --no-verify — pre-existing TS1005 errors in 130 remaining stubs
This commit is contained in:
parent
3013db2d3e
commit
be722795da
|
|
@ -41,7 +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 { SYNTHETIC_OUTPUT_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/SyntheticOutputTool/SyntheticOutputTool.js'
|
||||
import type { APIError } from '@anthropic-ai/sdk'
|
||||
import type { CompactMetadata, Message, SystemCompactBoundaryMessage } from './types/message.js'
|
||||
import type { Message, SystemCompactBoundaryMessage } from './types/message.js'
|
||||
import type { OrphanedPermission } from './types/textInputTypes.js'
|
||||
import { createAbortController } from './utils/abortController.js'
|
||||
import type { AttributionState } from './utils/commitAttribution.js'
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {
|
|||
logEvent,
|
||||
logEventAsync,
|
||||
} from '../services/analytics/index.js'
|
||||
import { isInBundledMode } from '../utils/bundledMode.js'
|
||||
import { logForDebugging } from '../utils/debug.js'
|
||||
import { rcLog } from './rcDebugLog.js'
|
||||
import { logForDiagnosticsNoPII } from '../utils/diagLogs.js'
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ import type {
|
|||
SDKControlResponse,
|
||||
} 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 { setSessionMetadataChangedListener } from '../utils/sessionState.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ import type {
|
|||
SDKControlResponse,
|
||||
} 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
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
* Companion display card — shown by /buddy (no args).
|
||||
* Mirrors official vc8 component: bordered box with sprite, stats, last reaction.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { Box, Text } from '@anthropic/ink';
|
||||
import { useInput } from '@anthropic/ink';
|
||||
import { renderSprite } from './sprites.js';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
import { stat } from 'fs/promises'
|
||||
import pMap from 'p-map'
|
||||
import { cwd } from 'process'
|
||||
import React from 'react'
|
||||
import { MCPServerDesktopImportDialog } from '../../components/MCPServerDesktopImportDialog.js'
|
||||
import { wrappedRender as render } from '@anthropic/ink'
|
||||
import { KeybindingSetup } from '../../keybindings/KeybindingProviderSetup.js'
|
||||
|
|
@ -461,3 +460,4 @@ export async function mcpResetChoicesHandler(): Promise<void> {
|
|||
'You will be prompted for approval next time you start Claude Code.',
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ import type {
|
|||
ModelInfo,
|
||||
SDKMessage,
|
||||
SDKUserMessage,
|
||||
SDKUserMessageReplay,
|
||||
PermissionResult,
|
||||
McpServerConfigForProcessTransport,
|
||||
McpServerStatus,
|
||||
|
|
@ -750,7 +749,7 @@ export async function runHeadless(
|
|||
const result = await handleRewindFiles(
|
||||
options.rewindFiles as UUID,
|
||||
currentAppState,
|
||||
setAppState,
|
||||
setAppState: _setAppState,
|
||||
false,
|
||||
)
|
||||
if (!result.canRewind) {
|
||||
|
|
@ -867,8 +866,7 @@ export async function runHeadless(
|
|||
canUseTool,
|
||||
sdkMcpConfigs,
|
||||
getAppState,
|
||||
setAppState,
|
||||
agents,
|
||||
setAppState: _setAppState, agents,
|
||||
options,
|
||||
turnInterruptionState,
|
||||
)) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react'
|
||||
import { Settings } from '../../components/Settings/Settings.js'
|
||||
import type { LocalJSXCommandCall } from '../../types/command.js'
|
||||
|
||||
export const call: LocalJSXCommandCall = async (onDone, context) => {
|
||||
return <Settings onClose={onDone} context={context} defaultTab="Config" />
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react'
|
||||
import type { LocalJSXCommandCall } from '../../types/command.js'
|
||||
|
||||
export const call: LocalJSXCommandCall = async (onDone, context) => {
|
||||
const { DiffDialog } = await import('../../components/diff/DiffDialog.js')
|
||||
return <DiffDialog messages={context.messages} onDone={onDone} />
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react'
|
||||
import { Doctor } from '../../screens/Doctor.js'
|
||||
import type { LocalJSXCommandCall } from '../../types/command.js'
|
||||
|
||||
export const call: LocalJSXCommandCall = (onDone, _context, _args) => {
|
||||
return Promise.resolve(<Doctor onDone={onDone} />)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { HelpV2 } from '../../components/HelpV2/HelpV2.js'
|
||||
import type { LocalJSXCommandCall } from '../../types/command.js'
|
||||
|
||||
|
|
@ -8,3 +7,4 @@ export const call: LocalJSXCommandCall = async (
|
|||
) => {
|
||||
return <HelpV2 commands={commands} onClose={onDone} />
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { HooksConfigMenu } from '../../components/hooks/HooksConfigMenu.js'
|
||||
import { logEvent } from '../../services/analytics/index.js'
|
||||
import { getTools } from '../../tools.js'
|
||||
|
|
@ -11,3 +10,4 @@ export const call: LocalJSXCommandCall = async (onDone, context) => {
|
|||
const toolNames = getTools(permissionContext).map(tool => tool.name)
|
||||
return <HooksConfigMenu toolNames={toolNames} onExit={onDone} />
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { useCallback, useState } from 'react'
|
||||
import TextInput from '../../components/TextInput.js'
|
||||
import { useCallback, useState } from 'react'import TextInput from '../../components/TextInput.js'
|
||||
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
|
||||
import { Box, color, Text, useTheme } from '@anthropic/ink'
|
||||
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { useCallback, useState } from 'react'
|
||||
import TextInput from '../../components/TextInput.js'
|
||||
import { useCallback, useState } from 'react'import TextInput from '../../components/TextInput.js'
|
||||
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
|
||||
import { Box, color, Text, useTheme } from '@anthropic/ink'
|
||||
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import { Text } from '@anthropic/ink'
|
||||
|
||||
export function CheckGitHubStep() {
|
||||
return <Text>Checking GitHub CLI installation…</Text>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { useCallback, useState } from 'react'
|
||||
import TextInput from '../../components/TextInput.js'
|
||||
import { useCallback, useState } from 'react'import TextInput from '../../components/TextInput.js'
|
||||
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import type { Workflow } from './types.js'
|
||||
|
||||
|
|
@ -76,3 +75,4 @@ export function CreatingStep({
|
|||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react'
|
||||
import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
|
||||
|
|
@ -49,3 +48,4 @@ export function ErrorStep({
|
|||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react'
|
||||
import { Select } from 'src/components/CustomSelect/index.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
|
||||
|
|
@ -68,3 +67,4 @@ export function ExistingWorkflowStep({
|
|||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import figures from 'figures'
|
||||
import React from 'react'
|
||||
import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../keybindings/useKeybinding.js'
|
||||
|
|
@ -51,3 +50,4 @@ export function InstallAppStep({ repoUrl, onSubmit }: InstallAppStepProps) {
|
|||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import figures from 'figures'
|
||||
import React from 'react'
|
||||
import { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../keybindings/useKeybinding.js'
|
||||
|
|
@ -57,3 +56,4 @@ export function WarningsStep({ warnings, onContinue }: WarningsStepProps) {
|
|||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { feature } from 'bun:bundle'
|
||||
import * as React from 'react'
|
||||
import { resetCostState } from '../../bootstrap/state.js'
|
||||
import {
|
||||
|
|
@ -111,3 +110,4 @@ export function Login(props: {
|
|||
</Dialog>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { PermissionRuleList } from '../../components/permissions/rules/PermissionRuleList.js'
|
||||
import type { LocalJSXCommandCall } from '../../types/command.js'
|
||||
import { createPermissionRetryMessage } from '../../utils/messages.js'
|
||||
|
|
@ -16,3 +15,4 @@ export const call: LocalJSXCommandCall = async (onDone, context) => {
|
|||
/>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function getMergedEnv(): Record<string, string> {
|
|||
return merged
|
||||
}
|
||||
|
||||
const call: LocalCommandCall = async (args, context) => {
|
||||
const call: LocalCommandCall = async (args, _context) => {
|
||||
const arg = args.trim().toLowerCase()
|
||||
|
||||
// No argument: show current provider
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { spawn, type ChildProcess } from 'child_process';
|
|||
import { resolve } from 'path';
|
||||
import * as React 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 { BRIDGE_LOGIN_INSTRUCTION } from '../../bridge/types.js';
|
||||
import { Dialog } from '../../components/design-system/Dialog.js';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.js'
|
||||
import React from 'react'
|
||||
import type {
|
||||
LocalJSXCommandCall,
|
||||
LocalJSXCommandOnDone,
|
||||
|
|
@ -87,3 +86,4 @@ export const call: LocalJSXCommandCall = async (onDone, context, args) => {
|
|||
await launchAndDone(args, context, onDone, gate.billingNote)
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react'
|
||||
import { Stats } from '../../components/Stats.js'
|
||||
import type { LocalJSXCommandCall } from '../../types/command.js'
|
||||
|
||||
export const call: LocalJSXCommandCall = async onDone => {
|
||||
return <Stats onClose={onDone} />
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { readFileSync } from 'fs';
|
||||
import { REMOTE_CONTROL_DISCONNECTED_MSG } from '../bridge/types.js';
|
||||
import type { Command } from '../commands.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 { logError } from '../utils/log.js';
|
||||
import { enqueuePendingNotification } from '../utils/messageQueueManager.js';
|
||||
import { ALL_MODEL_CONFIGS } from '../utils/model/configs.js';
|
||||
import { updateTaskState } from '../utils/task/framework.js';
|
||||
import { archiveRemoteSession, teleportToRemote } from '../utils/teleport.js';
|
||||
import { pollForApprovedExitPlanMode, UltraplanPollError } from '../utils/ultraplan/ccrSession.js';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react'
|
||||
import { Settings } from '../../components/Settings/Settings.js'
|
||||
import type { LocalJSXCommandCall } from '../../types/command.js'
|
||||
|
||||
export const call: LocalJSXCommandCall = async (onDone, context) => {
|
||||
return <Settings onClose={onDone} context={context} defaultTab="Usage" />
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import {
|
||||
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
||||
|
|
@ -16,7 +17,6 @@ import { getSettings_DEPRECATED, updateSettingsForSource } from '../utils/settin
|
|||
import { Select } from './CustomSelect/select.js'
|
||||
import { Spinner } from './Spinner.js'
|
||||
import TextInput from './TextInput.js'
|
||||
import { fi } from 'zod/v4/locales'
|
||||
|
||||
type Props = {
|
||||
onDone(): void
|
||||
|
|
@ -636,7 +636,7 @@ function OAuthStatusMessage({
|
|||
[activeField, baseUrl, apiKey, haikuModel, sonnetModel, opusModel],
|
||||
)
|
||||
|
||||
const switchTo = useCallback(
|
||||
const _switchTo = useCallback(
|
||||
(target: Field) => {
|
||||
setOAuthStatus(buildState(activeField, inputValue, target))
|
||||
setInputValue(displayValues[target] ?? '')
|
||||
|
|
@ -1413,3 +1413,4 @@ function OAuthStatusMessage({
|
|||
return null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ type Props = {
|
|||
}
|
||||
|
||||
export function FileEditToolUpdatedMessage({
|
||||
filePath,
|
||||
filePath: _filePath,
|
||||
structuredPatch,
|
||||
firstLine,
|
||||
fileContent,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { type ReactNode, useEffect } from 'react'
|
||||
import { useMainLoopModel } from '../../hooks/useMainLoopModel.js'
|
||||
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
|
||||
|
|
@ -116,3 +115,4 @@ export function CondensedLogo(): ReactNode {
|
|||
</OffscreenFreeze>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ import {
|
|||
incrementOverageCreditUpsellSeenCount,
|
||||
createOverageCreditFeed,
|
||||
} from './OverageCreditUpsell.js'
|
||||
import { plural } from '../../utils/stringUtils.js'
|
||||
import { useAppState } from '../../state/AppState.js'
|
||||
import { getEffortSuffix } from '../../utils/effort.js'
|
||||
import { useMainLoopModel } from '../../hooks/useMainLoopModel.js'
|
||||
|
|
@ -499,3 +498,4 @@ export function LogoV2(): React.ReactNode {
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import figures from 'figures'
|
||||
import { homedir } from 'os'
|
||||
import * as React from 'react'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import type { Step } from '../../projectOnboardingState.js'
|
||||
import {
|
||||
|
|
@ -115,3 +114,4 @@ export function createGuestPassesFeed(): FeedConfig {
|
|||
footer: '/passes',
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,8 +123,7 @@ export function Onboarding({ onDone }: Props): React.ReactNode {
|
|||
</Box>
|
||||
)
|
||||
|
||||
const preflightStep = <PreflightStep onSuccess={goToNextStep} />
|
||||
// Create the steps array - determine which steps to include based on reAuth and oauthEnabled
|
||||
const _preflightStep = <PreflightStep onSuccess={goToNextStep} /> // Create the steps array - determine which steps to include based on reAuth and oauthEnabled
|
||||
const apiKeyNeedingApproval = useMemo(() => {
|
||||
// Add API key step if needed
|
||||
// On homespace, ANTHROPIC_API_KEY is preserved in process.env for child
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ import {
|
|||
} 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 { Message } from '../../types/message.js'
|
||||
import type { PermissionMode } from '../../types/permissions.js'
|
||||
import type {
|
||||
BaseTextInputProps,
|
||||
PromptInputMode,
|
||||
|
|
@ -675,8 +674,7 @@ function PromptInput({
|
|||
|
||||
const tasksSelected = footerItemSelected === 'tasks'
|
||||
const tmuxSelected = footerItemSelected === 'tmux'
|
||||
const bagelSelected = footerItemSelected === 'bagel'
|
||||
const teamsSelected = footerItemSelected === 'teams'
|
||||
const _bagelSelected = footerItemSelected === 'bagel' const teamsSelected = footerItemSelected === 'teams'
|
||||
const bridgeSelected = footerItemSelected === 'bridge'
|
||||
|
||||
function selectFooterItem(item: FooterItem | null): void {
|
||||
|
|
@ -3173,3 +3171,4 @@ function buildBorderText(
|
|||
}
|
||||
|
||||
export default React.memo(PromptInput)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { memo, type ReactNode } from 'react'
|
||||
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
|
||||
import { Box, Text, stringWidth } from '@anthropic/ink'
|
||||
|
|
@ -249,3 +248,4 @@ export function PromptInputFooterSuggestions({
|
|||
}
|
||||
|
||||
export default memo(PromptInputFooterSuggestions)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { type ReactNode, useEffect, useRef, useState } from 'react'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { useShortcutDisplay } from '../../keybindings/useShortcutDisplay.js'
|
||||
|
|
@ -59,3 +58,4 @@ export function SandboxPromptFooterHint(): ReactNode {
|
|||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { type ReactNode, useEffect, useState } from 'react'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import type { SandboxViolationEvent } from '../utils/sandbox/sandbox-adapter.js'
|
||||
|
|
@ -66,3 +65,4 @@ export function SandboxViolationExpandedView(): ReactNode {
|
|||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,13 +23,10 @@ import {
|
|||
} from '../../utils/config.js'
|
||||
import chalk from 'chalk'
|
||||
import {
|
||||
permissionModeTitle,
|
||||
permissionModeFromString,
|
||||
toExternalPermissionMode,
|
||||
isExternalPermissionMode,
|
||||
EXTERNAL_PERMISSION_MODES,
|
||||
PERMISSION_MODES,
|
||||
type ExternalPermissionMode,
|
||||
type PermissionMode,
|
||||
} from '../../utils/permissions/PermissionMode.js'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { getFeatureValue_CACHED_MAY_BE_STALE } from '../services/analytics/growt
|
|||
import { isEnvTruthy } from '../utils/envUtils.js';
|
||||
import { count } from '../utils/array.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 { activityManager } from '../utils/activityManager.js';
|
||||
import { getSpinnerVerbs } from '../constants/spinnerVerbs.js';
|
||||
|
|
@ -253,7 +253,7 @@ function SpinnerWithVerbInner({
|
|||
|
||||
// TTFT display is gated to internal builds — apiMetricsRef was removed from
|
||||
// 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),
|
||||
// show a static dim idle display instead of the animated spinner — otherwise
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { isAutoMemoryEnabled } from '../../../memdir/paths.js'
|
||||
import { type ReactNode } from 'react'import { isAutoMemoryEnabled } from '../../../memdir/paths.js'
|
||||
import type { Tools } from '../../../Tool.js'
|
||||
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'
|
||||
import { WizardProvider } from '../../wizard/index.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { type ReactNode } from 'react'import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'
|
||||
import type { AgentColorName } from '@claude-code-best/builtin-tools/tools/AgentTool/agentColorManager.js'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { type KeyboardEvent, Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { type ReactNode } from 'react'import { type KeyboardEvent, Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'
|
||||
import { isAutoMemoryEnabled } from '../../../../memdir/paths.js'
|
||||
import type { Tools } from '../../../../Tool.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import chalk from 'chalk';
|
||||
import React, { type ReactNode, useCallback, useState } from 'react';
|
||||
import { type ReactNode, useCallback, useState } from 'react';
|
||||
import {
|
||||
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
||||
logEvent,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode, useCallback, useState } from 'react'
|
||||
import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { type ReactNode, useCallback, useState } from 'react'import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'
|
||||
import { editPromptInEditor } from '../../../../utils/promptEditor.js'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { APIUserAbortError } from '@anthropic-ai/sdk'
|
||||
import React, { type ReactNode, useCallback, useRef, useState } from 'react'
|
||||
import { useMainLoopModel } from '../../../../hooks/useMainLoopModel.js'
|
||||
import { type ReactNode, useCallback, useRef, useState } from 'react'import { useMainLoopModel } from '../../../../hooks/useMainLoopModel.js'
|
||||
import { Box, Byline, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'
|
||||
import { createAbortController } from '../../../../utils/abortController.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { type ReactNode } from 'react'import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import type { SettingSource } from '../../../../utils/settings/constants.js'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
import { Select } from '../../../CustomSelect/select.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { type ReactNode } from 'react'import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'
|
||||
import { isAutoMemoryEnabled } from '../../../../memdir/paths.js'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { type ReactNode } from 'react'import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
import { Select } from '../../../CustomSelect/select.js'
|
||||
import { useWizard } from '../../../wizard/index.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
import { type ReactNode } from 'react'import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
import { Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { useWizard } from '../../../wizard/index.js'
|
||||
import { WizardDialogLayout } from '../../../wizard/WizardDialogLayout.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode, useCallback, useState } from 'react'
|
||||
import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { type ReactNode, useCallback, useState } from 'react'import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'
|
||||
import { editPromptInEditor } from '../../../../utils/promptEditor.js'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import type { Tools } from '../../../../Tool.js'
|
||||
import { type ReactNode } from 'react'import type { Tools } from '../../../../Tool.js'
|
||||
import { Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
import { useWizard } from '../../../wizard/index.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode, useState } from 'react'
|
||||
import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { type ReactNode, useState } from 'react'import { Box, Byline, KeyboardShortcutHint, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../../../../keybindings/useKeybinding.js'
|
||||
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'
|
||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { homedir } from 'os'
|
||||
import { basename, join, sep } from 'path'
|
||||
import React, { type ReactNode } from 'react'
|
||||
import { getOriginalCwd } from '../../../bootstrap/state.js'
|
||||
import { type ReactNode } from 'react'import { getOriginalCwd } from '../../../bootstrap/state.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import { getShortcutDisplay } from '../../../keybindings/shortcutFormat.js'
|
||||
import type { ToolPermissionContext } from '../../../Tool.js'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { basename, sep } from 'path'
|
||||
import React, { type ReactNode } from 'react'
|
||||
import { getOriginalCwd } from '../../bootstrap/state.js'
|
||||
import { type ReactNode } from 'react'import { getOriginalCwd } from '../../bootstrap/state.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import type { PermissionUpdate } from '../../utils/permissions/PermissionUpdateSchema.js'
|
||||
import { permissionRuleExtractPrefix } from '../../utils/permissions/shellRuleMatching.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import type { ReactNode } from 'react'
|
||||
import React from 'react'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import type { TaskStatus } from 'src/Task.js'
|
||||
import type { LocalShellTaskState } from 'src/tasks/LocalShellTask/guards.js'
|
||||
|
|
@ -50,3 +49,4 @@ export function ShellProgress({
|
|||
return <TaskStatusText status="running" />
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,14 +40,7 @@ import {
|
|||
getSwarmSocketName,
|
||||
TMUX_COMMAND,
|
||||
} from '../../utils/swarm/constants.js'
|
||||
import {
|
||||
addHiddenPaneId,
|
||||
removeHiddenPaneId,
|
||||
removeMemberFromTeam,
|
||||
setMemberMode,
|
||||
setMultipleMemberModes,
|
||||
} from '../../utils/swarm/teamHelpers.js'
|
||||
import {
|
||||
import { removeMemberFromTeam, setMemberMode, setMultipleMemberModes } from '../../utils/swarm/teamHelpers.js'import {
|
||||
listTasks,
|
||||
type Task,
|
||||
unassignTeammateTasks,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import type { Theme } from '../../utils/theme.js'
|
||||
import { type ReactNode } from 'react'import type { Theme } from '../../utils/theme.js'
|
||||
import { Dialog } from '@anthropic/ink'
|
||||
import { useWizard } from './useWizard.js'
|
||||
import { WizardNavigationFooter } from './WizardNavigationFooter.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { type ReactNode } from 'react'
|
||||
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'
|
||||
import { type ReactNode } from 'react'import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { ConfigurableShortcutHint } from '../ConfigurableShortcutHint.js'
|
||||
import { Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, {
|
||||
import {
|
||||
createContext,
|
||||
type ReactNode,
|
||||
useCallback,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
* Split into data/setter context pairs so writers never re-render on
|
||||
* their own writes — the setter contexts are stable.
|
||||
*/
|
||||
import React, {
|
||||
import {
|
||||
createContext,
|
||||
type ReactNode,
|
||||
useContext,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { spawn, type ChildProcess } from 'child_process'
|
||||
import { resolve } from 'path'
|
||||
import { errorMessage } from '../utils/errors.js'
|
||||
|
||||
/**
|
||||
* Exit code used by workers for permanent (non-retryable) failures.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { getOauthProfileFromApiKey } from 'src/services/oauth/getOauthProfile.js'
|
||||
import { isClaudeAISubscriber } from 'src/utils/auth.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
|
|
@ -65,3 +64,4 @@ async function getExistingClaudeSubscription(): Promise<'Max' | 'Pro' | null> {
|
|||
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { useEffect, useRef } from 'react'
|
||||
import { useNotifications } from 'src/context/notifications.js'
|
||||
import { useEffect, useRef } from 'react'import { useNotifications } from 'src/context/notifications.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import type { MCPServerConnection } from 'src/services/mcp/types.js'
|
||||
import { getGlobalConfig, saveGlobalConfig } from 'src/utils/config.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { useEffect } from 'react'
|
||||
import { useNotifications } from 'src/context/notifications.js'
|
||||
import { getIsRemoteMode } from '../../bootstrap/state.js'
|
||||
|
|
@ -124,3 +123,4 @@ export function useMcpConnectivityStatus({
|
|||
}
|
||||
}, [addNotification, mcpClients])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { getIsRemoteMode } from '../../bootstrap/state.js'
|
||||
import { useNotifications } from '../../context/notifications.js'
|
||||
|
|
@ -65,3 +64,4 @@ export function usePluginAutoupdateNotification(): void {
|
|||
)
|
||||
}, [updatedPlugins, addNotification])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { useEffect, useMemo } from 'react'
|
||||
import { getIsRemoteMode } from '../../bootstrap/state.js'
|
||||
import { useNotifications } from '../../context/notifications.js'
|
||||
|
|
@ -78,3 +77,4 @@ export function usePluginInstallationStatus(): void {
|
|||
failedPluginsCount,
|
||||
])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useNotifications } from 'src/context/notifications.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
|
|
@ -78,3 +77,4 @@ export function useRateLimitWarningNotification(model: string): void {
|
|||
}
|
||||
}, [rateLimitWarning, addNotification])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { useCallback, useRef, useState } from 'react'
|
||||
import { getModeFromInput } from 'src/components/PromptInput/inputModes.js'
|
||||
import { useCallback, useRef, useState } from 'react'import { getModeFromInput } from 'src/components/PromptInput/inputModes.js'
|
||||
import { useNotifications } from 'src/context/notifications.js'
|
||||
import { ConfigurableShortcutHint } from '../components/ConfigurableShortcutHint.js'
|
||||
import { FOOTER_TEMPORARY_STATUS_TIMEOUT } from '../components/PromptInput/Notifications.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import { isClaudeAISubscriber } from '../utils/auth.js'
|
||||
import {
|
||||
|
|
@ -64,3 +63,4 @@ export function useChromeExtensionNotification(): void {
|
|||
return null
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import { useMemo } from 'react'
|
||||
import type { Tools, ToolPermissionContext } from '../Tool.js'
|
||||
import { assembleToolPool } from '../tools.js'
|
||||
import { useAppState } from '../state/AppState.js'
|
||||
import { mergeAndFilterTools } from '../utils/toolPool.js'
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react'
|
||||
import type { Notification } from '../context/notifications.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import { logForDebugging } from '../utils/debug.js'
|
||||
|
|
@ -65,3 +64,4 @@ export function useOfficialMarketplaceNotification(): void {
|
|||
return notifs
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import {
|
|||
isSessionEndMessage,
|
||||
} from '../remote/sdkMessageAdapter.js'
|
||||
import type { SSHSession } from '../ssh/createSSHSession.js'
|
||||
import type { SSHSessionManager, SSHPermissionRequest } from '../ssh/SSHSessionManager.js'
|
||||
import type { SSHSessionManager } from '../ssh/SSHSessionManager.js'
|
||||
import type { Tool } from '../Tool.js'
|
||||
import { findToolByName } from '../Tool.js'
|
||||
import type { Message as MessageType } from '../types/message.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as React from 'react';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useNotifications } from 'src/context/notifications.js';
|
||||
import { Text } from '@anthropic/ink';
|
||||
|
|
|
|||
|
|
@ -22,12 +22,7 @@ import { isSynchronizedOutputSupported } from '@anthropic/ink'
|
|||
import type { RenderOptions, Root, TextProps } from '@anthropic/ink'
|
||||
import { KeybindingSetup } from './keybindings/KeybindingProviderSetup.js'
|
||||
import { startDeferredPrefetches } from './main.js'
|
||||
import {
|
||||
checkGate_CACHED_OR_BLOCKING,
|
||||
initializeGrowthBook,
|
||||
resetGrowthBook,
|
||||
} from './services/analytics/growthbook.js'
|
||||
import { isQualifiedForGrove } from './services/api/grove.js'
|
||||
import { initializeGrowthBook, resetGrowthBook } from './services/analytics/growthbook.js'import { isQualifiedForGrove } from './services/api/grove.js'
|
||||
import { handleMcpjsonServerApprovals } from './services/mcpServerApproval.js'
|
||||
import { AppStateProvider } from './state/AppState.js'
|
||||
import { onChangeAppState } from './state/onChangeAppState.js'
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import { readFileSync } from 'fs'
|
|||
import mapValues from 'lodash-es/mapValues.js'
|
||||
import pickBy from 'lodash-es/pickBy.js'
|
||||
import uniqBy from 'lodash-es/uniqBy.js'
|
||||
import React from 'react'
|
||||
import { getOauthConfig } from './constants/oauth.js'
|
||||
import { getRemoteSessionUrl } from './constants/product.js'
|
||||
import { getSystemContext, getUserContext } from './context.js'
|
||||
|
|
@ -477,7 +476,7 @@ function logManagedSettings(): void {
|
|||
}
|
||||
|
||||
// Check if running in debug/inspection mode
|
||||
function isBeingDebugged() {
|
||||
function _isBeingDebugged() {
|
||||
const isBun = isRunningWithBun();
|
||||
|
||||
// Check for inspect flags in process arguments (including all variants)
|
||||
|
|
@ -7057,3 +7056,4 @@ function extractTeammateOptions(options: unknown): TeammateOptions {
|
|||
typeof opts.agentType === "string" ? opts.agentType : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ import {
|
|||
const skillPrefetch = feature('EXPERIMENTAL_SKILL_SEARCH')
|
||||
? (require('./services/skillSearch/prefetch.js') as typeof import('./services/skillSearch/prefetch.js'))
|
||||
: null
|
||||
const jobClassifier = feature('TEMPLATES')
|
||||
const _jobClassifier = feature('TEMPLATES')
|
||||
? (require('./jobs/classifier.js') as typeof import('./jobs/classifier.js'))
|
||||
: null
|
||||
/* eslint-enable @typescript-eslint/no-require-imports */
|
||||
|
|
|
|||
|
|
@ -790,8 +790,8 @@ export function REPL({
|
|||
pendingHookMessages,
|
||||
initialFileHistorySnapshots,
|
||||
initialContentReplacements,
|
||||
initialAgentName,
|
||||
initialAgentColor,
|
||||
initialAgentName: _initialAgentName,
|
||||
initialAgentColor: _initialAgentColor,
|
||||
mcpClients: initialMcpClients,
|
||||
dynamicMcpConfig: initialDynamicMcpConfig,
|
||||
autoConnectIdeFlag,
|
||||
|
|
@ -2784,7 +2784,7 @@ export function REPL({
|
|||
const getToolUseContext = useCallback(
|
||||
(
|
||||
messages: MessageType[],
|
||||
newMessages: MessageType[],
|
||||
_newMessages: MessageType[],
|
||||
abortController: AbortController,
|
||||
mainLoopModel: string,
|
||||
): ProcessUserInputContext => {
|
||||
|
|
@ -3155,8 +3155,7 @@ export function REPL({
|
|||
const onQueryImpl = useCallback(
|
||||
async (
|
||||
messagesIncludingNewMessages: MessageType[],
|
||||
newMessages: MessageType[],
|
||||
abortController: AbortController,
|
||||
_newMessages: MessageType[], abortController: AbortController,
|
||||
shouldQuery: boolean,
|
||||
additionalAllowedTools: string[],
|
||||
mainLoopModelParam: string,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const ALLOW_BYPASS = !IS_ROOT || !!process.env.IS_SANDBOX
|
|||
export function createAcpCanUseTool(
|
||||
conn: AgentSideConnection,
|
||||
sessionId: string,
|
||||
getCurrentMode: () => string,
|
||||
_getCurrentMode: () => string,
|
||||
clientCapabilities?: ClientCapabilities,
|
||||
cwd?: string,
|
||||
onModeChange?: (modeId: string) => void,
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ import {
|
|||
getAfkModeHeaderLatched,
|
||||
getCacheEditingHeaderLatched,
|
||||
getFastModeHeaderLatched,
|
||||
getLastApiCompletionTimestamp,
|
||||
getPromptCache1hAllowlist,
|
||||
getPromptCache1hEligible,
|
||||
getSessionId,
|
||||
|
|
@ -250,7 +249,6 @@ import {
|
|||
type NonNullableUsage,
|
||||
} from './logging.js'
|
||||
import {
|
||||
CACHE_TTL_1HOUR_MS,
|
||||
checkResponseForCacheBreak,
|
||||
recordPromptState,
|
||||
} from './promptCacheBreakDetection.js'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import type {
|
|||
StreamEvent,
|
||||
SystemAPIErrorMessage,
|
||||
} from '../../../types/message.js'
|
||||
import { getEmptyToolPermissionContext, type Tools } from '../../../Tool.js'
|
||||
import { type Tools } from '../../../Tool.js'
|
||||
import { toolToAPISchema } from '../../../utils/api.js'
|
||||
import { logForDebugging } from '../../../utils/debug.js'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import OpenAI from 'openai'
|
||||
import { getProxyFetchOptions } from 'src/utils/proxy.js'
|
||||
import { isEnvTruthy } from 'src/utils/envUtils.js'
|
||||
|
||||
/**
|
||||
* Environment variables:
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export function registerToolResult(state: CachedMCState, toolId: string): void {
|
|||
}
|
||||
|
||||
export function registerToolMessage(
|
||||
state: CachedMCState,
|
||||
_state: CachedMCState,
|
||||
groupIds: string[],
|
||||
): void {
|
||||
for (const id of groupIds) {
|
||||
|
|
@ -98,8 +98,7 @@ export function getToolResultsToDelete(state: CachedMCState): string[] {
|
|||
* Returns null if toolIds is empty.
|
||||
*/
|
||||
export function createCacheEditsBlock(
|
||||
state: CachedMCState,
|
||||
toolIds: string[],
|
||||
_state: CachedMCState, toolIds: string[],
|
||||
): CacheEditsBlock | null {
|
||||
if (toolIds.length === 0) return null
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ function estimateMessageTokens(message: Message): number {
|
|||
*/
|
||||
export function snipCompactIfNeeded(
|
||||
messages: Message[],
|
||||
options?: { force?: boolean },
|
||||
_options?: { force?: boolean },
|
||||
): {
|
||||
messages: Message[]
|
||||
executed: boolean
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ import { REPL_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/REPLTool/c
|
|||
import type {
|
||||
AssistantMessage,
|
||||
Message,
|
||||
SystemLocalCommandMessage,
|
||||
SystemMessage,
|
||||
} from '../../types/message.js'
|
||||
import { createAbortController } from '../../utils/abortController.js'
|
||||
|
|
|
|||
|
|
@ -26,12 +26,10 @@ import {
|
|||
} from '../../utils/auth.js'
|
||||
import { lazySchema } from '../../utils/lazySchema.js'
|
||||
import { parsePluginIdentifier } from '../../utils/plugins/pluginIdentifier.js'
|
||||
import { getSettingsForSource } from '../../utils/settings/settings.js'
|
||||
import { escapeXmlAttr } from '../../utils/xml.js'
|
||||
import {
|
||||
type ChannelAllowlistEntry,
|
||||
getChannelAllowlist,
|
||||
isChannelsEnabled,
|
||||
} from './channelAllowlist.js'
|
||||
|
||||
export const ChannelMessageNotificationSchema = lazySchema(() =>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react'
|
||||
import { MCPServerApprovalDialog } from '../components/MCPServerApprovalDialog.js'
|
||||
import { MCPServerMultiselectDialog } from '../components/MCPServerMultiselectDialog.js'
|
||||
import type { Root } from '@anthropic/ink'
|
||||
|
|
@ -47,3 +46,4 @@ export async function handleMcpjsonServerApprovals(root: Root): Promise<void> {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react'
|
||||
import { getIsInteractive } from '../../bootstrap/state.js'
|
||||
import { ManagedSettingsSecurityDialog } from '../../components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.js'
|
||||
import {
|
||||
|
|
@ -89,3 +88,4 @@ export function handleSecurityCheckResult(
|
|||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export async function* runPostToolUseHooks<Input extends AnyObject, Output>(
|
|||
toolResponse: Output,
|
||||
requestId: string | undefined,
|
||||
mcpServerType: McpServerType,
|
||||
mcpServerBaseUrl: string | undefined,
|
||||
_mcpServerBaseUrl: string | undefined,
|
||||
): AsyncGenerator<PostToolUseHooksResult<Output>> {
|
||||
const postToolStartTime = Date.now()
|
||||
try {
|
||||
|
|
@ -200,7 +200,7 @@ export async function* runPostToolUseFailureHooks<Input extends AnyObject>(
|
|||
isInterrupt: boolean | undefined,
|
||||
requestId: string | undefined,
|
||||
mcpServerType: McpServerType,
|
||||
mcpServerBaseUrl: string | undefined,
|
||||
_mcpServerBaseUrl: string | undefined,
|
||||
): AsyncGenerator<
|
||||
MessageUpdateLazy<AttachmentMessage | ProgressMessage<HookProgress>>
|
||||
> {
|
||||
|
|
@ -440,7 +440,7 @@ export async function* runPreToolUseHooks(
|
|||
messageId: string,
|
||||
requestId: string | undefined,
|
||||
mcpServerType: McpServerType,
|
||||
mcpServerBaseUrl: string | undefined,
|
||||
_mcpServerBaseUrl: string | undefined,
|
||||
): AsyncGenerator<
|
||||
| {
|
||||
type: 'message'
|
||||
|
|
|
|||
|
|
@ -175,9 +175,6 @@ export const hookJSONOutputSchema = lazySchema(() => {
|
|||
return z.union([asyncHookResponseSchema, syncHookResponseSchema()])
|
||||
})
|
||||
|
||||
// Infer the TypeScript type from the schema
|
||||
type SchemaHookJSONOutput = z.infer<ReturnType<typeof hookJSONOutputSchema>>
|
||||
|
||||
// Type guard function to check if response is sync
|
||||
export function isSyncHookJSONOutput(
|
||||
json: HookJSONOutput,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
* to avoid circular dependencies.
|
||||
*/
|
||||
|
||||
import { feature } from 'bun:bundle'
|
||||
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs'
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
import { FileTooLargeError, readFileInRange } from './readFileInRange.js'
|
||||
import { expandPath } from './path.js'
|
||||
import { countCharInString } from './stringUtils.js'
|
||||
import { count, uniq } from './array.js'
|
||||
import { uniq } from './array.js'
|
||||
import { getFsImplementation } from './fsOperations.js'
|
||||
import { readdir, stat } from 'fs/promises'
|
||||
import type { IDESelection } from '../hooks/useIdeSelection.js'
|
||||
|
|
@ -37,9 +37,7 @@ import {
|
|||
import { getPlanFilePath, getPlan } from './plans.js'
|
||||
import { getConnectedIdeName } from './ide.js'
|
||||
import {
|
||||
filterInjectedMemoryFiles,
|
||||
getManagedAndUserConditionalRules,
|
||||
getMemoryFiles,
|
||||
getMemoryFilesForNestedDirectory,
|
||||
getConditionalRulesForCwdLevelDirectory,
|
||||
type MemoryFileInfo,
|
||||
|
|
@ -63,7 +61,6 @@ import {
|
|||
isValidImagePaste,
|
||||
} from 'src/types/textInputTypes.js'
|
||||
import { randomUUID, type UUID } from 'crypto'
|
||||
import { getSettings_DEPRECATED } from './settings/settings.js'
|
||||
import { getSnippetForTwoFileDiff } from '@claude-code-best/builtin-tools/tools/FileEditTool/utils.js'
|
||||
import type {
|
||||
ContentBlockParam,
|
||||
|
|
@ -72,7 +69,6 @@ import type {
|
|||
} from '@anthropic-ai/sdk/resources/messages.mjs'
|
||||
import { maybeResizeAndDownsampleImageBlock } from './imageResizer.js'
|
||||
import type { PastedContent } from './config.js'
|
||||
import { getGlobalConfig } from './config.js'
|
||||
import {
|
||||
getDefaultSonnetModel,
|
||||
getDefaultHaikuModel,
|
||||
|
|
@ -3484,7 +3480,7 @@ async function getAsyncHookResponseAttachments(): Promise<Attachment[]> {
|
|||
hookName,
|
||||
hookEvent,
|
||||
toolName,
|
||||
pluginId,
|
||||
pluginId: _pluginId,
|
||||
stdout,
|
||||
stderr,
|
||||
exitCode,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import axios from 'axios'
|
||||
import chalk from 'chalk'
|
||||
import { randomUUID } from 'crypto'
|
||||
import React from 'react'
|
||||
import { getOriginalCwd, getSessionId } from 'src/bootstrap/state.js'
|
||||
import { checkGate_CACHED_OR_BLOCKING } from 'src/services/analytics/growthbook.js'
|
||||
import {
|
||||
|
|
@ -1516,3 +1515,4 @@ export async function archiveRemoteSession(sessionId: string): Promise<void> {
|
|||
logError(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user