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 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 { CompactMetadata, Message, SystemCompactBoundaryMessage } from './types/message.js'
|
import type { 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'
|
||||||
|
|
|
||||||
|
|
@ -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 { logForDebugging } from '../utils/debug.js'
|
import { logForDebugging } from '../utils/debug.js'
|
||||||
import { rcLog } from './rcDebugLog.js'
|
import { rcLog } from './rcDebugLog.js'
|
||||||
import { logForDiagnosticsNoPII } from '../utils/diagLogs.js'
|
import { logForDiagnosticsNoPII } from '../utils/diagLogs.js'
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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';
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -461,3 +460,4 @@ export async function mcpResetChoicesHandler(): Promise<void> {
|
||||||
'You will be prompted for approval next time you start Claude Code.',
|
'You will be prompted for approval next time you start Claude Code.',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,6 @@ import type {
|
||||||
ModelInfo,
|
ModelInfo,
|
||||||
SDKMessage,
|
SDKMessage,
|
||||||
SDKUserMessage,
|
SDKUserMessage,
|
||||||
SDKUserMessageReplay,
|
|
||||||
PermissionResult,
|
PermissionResult,
|
||||||
McpServerConfigForProcessTransport,
|
McpServerConfigForProcessTransport,
|
||||||
McpServerStatus,
|
McpServerStatus,
|
||||||
|
|
@ -750,7 +749,7 @@ export async function runHeadless(
|
||||||
const result = await handleRewindFiles(
|
const result = await handleRewindFiles(
|
||||||
options.rewindFiles as UUID,
|
options.rewindFiles as UUID,
|
||||||
currentAppState,
|
currentAppState,
|
||||||
setAppState,
|
setAppState: _setAppState,
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
if (!result.canRewind) {
|
if (!result.canRewind) {
|
||||||
|
|
@ -867,8 +866,7 @@ export async function runHeadless(
|
||||||
canUseTool,
|
canUseTool,
|
||||||
sdkMcpConfigs,
|
sdkMcpConfigs,
|
||||||
getAppState,
|
getAppState,
|
||||||
setAppState,
|
setAppState: _setAppState, agents,
|
||||||
agents,
|
|
||||||
options,
|
options,
|
||||||
turnInterruptionState,
|
turnInterruptionState,
|
||||||
)) {
|
)) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
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'
|
||||||
|
|
||||||
export const call: LocalJSXCommandCall = async (onDone, context) => {
|
export const call: LocalJSXCommandCall = async (onDone, context) => {
|
||||||
return <Settings onClose={onDone} context={context} defaultTab="Config" />
|
return <Settings onClose={onDone} context={context} defaultTab="Config" />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
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) => {
|
||||||
const { DiffDialog } = await import('../../components/diff/DiffDialog.js')
|
const { DiffDialog } = await import('../../components/diff/DiffDialog.js')
|
||||||
return <DiffDialog messages={context.messages} onDone={onDone} />
|
return <DiffDialog messages={context.messages} onDone={onDone} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
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'
|
||||||
|
|
||||||
export const call: LocalJSXCommandCall = (onDone, _context, _args) => {
|
export const call: LocalJSXCommandCall = (onDone, _context, _args) => {
|
||||||
return Promise.resolve(<Doctor onDone={onDone} />)
|
return Promise.resolve(<Doctor onDone={onDone} />)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
||||||
|
|
@ -8,3 +7,4 @@ export const call: LocalJSXCommandCall = async (
|
||||||
) => {
|
) => {
|
||||||
return <HelpV2 commands={commands} onClose={onDone} />
|
return <HelpV2 commands={commands} onClose={onDone} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -11,3 +10,4 @@ export const call: LocalJSXCommandCall = async (onDone, context) => {
|
||||||
const toolNames = getTools(permissionContext).map(tool => tool.name)
|
const toolNames = getTools(permissionContext).map(tool => tool.name)
|
||||||
return <HooksConfigMenu toolNames={toolNames} onExit={onDone} />
|
return <HooksConfigMenu toolNames={toolNames} onExit={onDone} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
|
||||||
import { Text } from '@anthropic/ink'
|
import { Text } from '@anthropic/ink'
|
||||||
|
|
||||||
export function CheckGitHubStep() {
|
export function CheckGitHubStep() {
|
||||||
return <Text>Checking GitHub CLI installation…</Text>
|
return <Text>Checking GitHub CLI installation…</Text>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
import { useKeybindings } from '../../keybindings/useKeybinding.js'
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
||||||
|
|
@ -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 { GITHUB_ACTION_SETUP_DOCS_URL } from '../../constants/github-app.js'
|
||||||
import { Box, Text } from '@anthropic/ink'
|
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 { Select } from 'src/components/CustomSelect/index.js'
|
||||||
import { Box, Text } from '@anthropic/ink'
|
import { Box, Text } from '@anthropic/ink'
|
||||||
|
|
||||||
|
|
@ -68,3 +67,4 @@ export function ExistingWorkflowStep({
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -51,3 +50,4 @@ export function InstallAppStep({ repoUrl, onSubmit }: InstallAppStepProps) {
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -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 * as React from 'react'
|
||||||
import { resetCostState } from '../../bootstrap/state.js'
|
import { resetCostState } from '../../bootstrap/state.js'
|
||||||
import {
|
import {
|
||||||
|
|
@ -111,3 +110,4 @@ export function Login(props: {
|
||||||
</Dialog>
|
</Dialog>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -16,3 +15,4 @@ export const call: LocalJSXCommandCall = async (onDone, context) => {
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,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
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { spawn, 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';
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
import type {
|
||||||
LocalJSXCommandCall,
|
LocalJSXCommandCall,
|
||||||
LocalJSXCommandOnDone,
|
LocalJSXCommandOnDone,
|
||||||
|
|
@ -87,3 +86,4 @@ export const call: LocalJSXCommandCall = async (onDone, context, args) => {
|
||||||
await launchAndDone(args, context, onDone, gate.billingNote)
|
await launchAndDone(args, context, onDone, gate.billingNote)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
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'
|
||||||
|
|
||||||
export const call: LocalJSXCommandCall = async onDone => {
|
export const call: LocalJSXCommandCall = async onDone => {
|
||||||
return <Stats onClose={onDone} />
|
return <Stats onClose={onDone} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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';
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
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'
|
||||||
|
|
||||||
export const call: LocalJSXCommandCall = async (onDone, context) => {
|
export const call: LocalJSXCommandCall = async (onDone, context) => {
|
||||||
return <Settings onClose={onDone} context={context} defaultTab="Usage" />
|
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 React, { useCallback, useEffect, useRef, 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,
|
||||||
|
|
@ -16,7 +17,6 @@ import { getSettings_DEPRECATED, updateSettingsForSource } from '../utils/settin
|
||||||
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
|
||||||
|
|
@ -636,7 +636,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] ?? '')
|
||||||
|
|
@ -1413,3 +1413,4 @@ function OAuthStatusMessage({
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ type Props = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function FileEditToolUpdatedMessage({
|
export function FileEditToolUpdatedMessage({
|
||||||
filePath,
|
filePath: _filePath,
|
||||||
structuredPatch,
|
structuredPatch,
|
||||||
firstLine,
|
firstLine,
|
||||||
fileContent,
|
fileContent,
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -116,3 +115,4 @@ export function CondensedLogo(): ReactNode {
|
||||||
</OffscreenFreeze>
|
</OffscreenFreeze>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,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'
|
||||||
|
|
@ -499,3 +498,4 @@ export function LogoV2(): React.ReactNode {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
import {
|
||||||
|
|
@ -115,3 +114,4 @@ export function createGuestPassesFeed(): FeedConfig {
|
||||||
footer: '/passes',
|
footer: '/passes',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,8 +123,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
|
||||||
// On homespace, ANTHROPIC_API_KEY is preserved in process.env for child
|
// 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'
|
} 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 {
|
import type {
|
||||||
BaseTextInputProps,
|
BaseTextInputProps,
|
||||||
PromptInputMode,
|
PromptInputMode,
|
||||||
|
|
@ -675,8 +674,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'
|
||||||
|
|
||||||
function selectFooterItem(item: FooterItem | null): void {
|
function selectFooterItem(item: FooterItem | null): void {
|
||||||
|
|
@ -3173,3 +3171,4 @@ function buildBorderText(
|
||||||
}
|
}
|
||||||
|
|
||||||
export default React.memo(PromptInput)
|
export default React.memo(PromptInput)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -249,3 +248,4 @@ export function PromptInputFooterSuggestions({
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(PromptInputFooterSuggestions)
|
export default memo(PromptInputFooterSuggestions)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -59,3 +58,4 @@ export function SandboxPromptFooterHint(): ReactNode {
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -66,3 +65,4 @@ export function SandboxViolationExpandedView(): ReactNode {
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,10 @@ import {
|
||||||
} from '../../utils/config.js'
|
} from '../../utils/config.js'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import {
|
import {
|
||||||
permissionModeTitle,
|
|
||||||
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 {
|
||||||
|
|
|
||||||
|
|
@ -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';
|
||||||
|
|
@ -253,7 +253,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
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { WizardProvider } from '../../wizard/index.js'
|
import { WizardProvider } from '../../wizard/index.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import type { Tools } from '../../../../Tool.js'
|
import type { Tools } from '../../../../Tool.js'
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +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'
|
||||||
import { createAbortController } from '../../../../utils/abortController.js'
|
import { createAbortController } from '../../../../utils/abortController.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { Select } from '../../../CustomSelect/select.js'
|
import { Select } from '../../../CustomSelect/select.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { useWizard } from '../../../wizard/index.js'
|
import { useWizard } from '../../../wizard/index.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { WizardDialogLayout } from '../../../wizard/WizardDialogLayout.js'
|
import { WizardDialogLayout } from '../../../wizard/WizardDialogLayout.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { useWizard } from '../../../wizard/index.js'
|
import { useWizard } from '../../../wizard/index.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +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'
|
||||||
import type { ToolPermissionContext } from '../../../Tool.js'
|
import type { ToolPermissionContext } from '../../../Tool.js'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +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'
|
||||||
import { permissionRuleExtractPrefix } from '../../utils/permissions/shellRuleMatching.js'
|
import { permissionRuleExtractPrefix } from '../../utils/permissions/shellRuleMatching.js'
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -50,3 +49,4 @@ export function ShellProgress({
|
||||||
return <TaskStatusText status="running" />
|
return <TaskStatusText status="running" />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,14 +40,7 @@ import {
|
||||||
getSwarmSocketName,
|
getSwarmSocketName,
|
||||||
TMUX_COMMAND,
|
TMUX_COMMAND,
|
||||||
} from '../../utils/swarm/constants.js'
|
} from '../../utils/swarm/constants.js'
|
||||||
import {
|
import { removeMemberFromTeam, setMemberMode, setMultipleMemberModes } from '../../utils/swarm/teamHelpers.js'import {
|
||||||
addHiddenPaneId,
|
|
||||||
removeHiddenPaneId,
|
|
||||||
removeMemberFromTeam,
|
|
||||||
setMemberMode,
|
|
||||||
setMultipleMemberModes,
|
|
||||||
} from '../../utils/swarm/teamHelpers.js'
|
|
||||||
import {
|
|
||||||
listTasks,
|
listTasks,
|
||||||
type Task,
|
type Task,
|
||||||
unassignTeammateTasks,
|
unassignTeammateTasks,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { WizardNavigationFooter } from './WizardNavigationFooter.js'
|
import { WizardNavigationFooter } from './WizardNavigationFooter.js'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
import { Byline, KeyboardShortcutHint } from '@anthropic/ink'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
type ReactNode,
|
type ReactNode,
|
||||||
useCallback,
|
useCallback,
|
||||||
|
|
|
||||||
|
|
@ -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, {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
type ReactNode,
|
type ReactNode,
|
||||||
useContext,
|
useContext,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { spawn, type ChildProcess } from 'child_process'
|
import { spawn, type ChildProcess } from 'child_process'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { errorMessage } from '../utils/errors.js'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exit code used by workers for permanent (non-retryable) failures.
|
* 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 { 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'
|
||||||
|
|
@ -65,3 +64,4 @@ async function getExistingClaudeSubscription(): Promise<'Max' | 'Pro' | null> {
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { getGlobalConfig, saveGlobalConfig } from 'src/utils/config.js'
|
import { getGlobalConfig, saveGlobalConfig } from 'src/utils/config.js'
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -124,3 +123,4 @@ export function useMcpConnectivityStatus({
|
||||||
}
|
}
|
||||||
}, [addNotification, mcpClients])
|
}, [addNotification, mcpClients])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -65,3 +64,4 @@ export function usePluginAutoupdateNotification(): void {
|
||||||
)
|
)
|
||||||
}, [updatedPlugins, addNotification])
|
}, [updatedPlugins, addNotification])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -78,3 +77,4 @@ export function usePluginInstallationStatus(): void {
|
||||||
failedPluginsCount,
|
failedPluginsCount,
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -78,3 +77,4 @@ export function useRateLimitWarningNotification(model: string): void {
|
||||||
}
|
}
|
||||||
}, [rateLimitWarning, addNotification])
|
}, [rateLimitWarning, addNotification])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +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'
|
||||||
import { FOOTER_TEMPORARY_STATUS_TIMEOUT } from '../components/PromptInput/Notifications.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 { Text } from '@anthropic/ink'
|
||||||
import { isClaudeAISubscriber } from '../utils/auth.js'
|
import { isClaudeAISubscriber } from '../utils/auth.js'
|
||||||
import {
|
import {
|
||||||
|
|
@ -64,3 +63,4 @@ export function useChromeExtensionNotification(): void {
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
@ -65,3 +64,4 @@ export function useOfficialMarketplaceNotification(): void {
|
||||||
return notifs
|
return notifs
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +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 { SSHSessionManager, SSHPermissionRequest } from '../ssh/SSHSessionManager.js'
|
import type { SSHSessionManager } 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'
|
||||||
|
|
|
||||||
|
|
@ -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';
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,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'import { isQualifiedForGrove } from './services/api/grove.js'
|
||||||
checkGate_CACHED_OR_BLOCKING,
|
|
||||||
initializeGrowthBook,
|
|
||||||
resetGrowthBook,
|
|
||||||
} from './services/analytics/growthbook.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'
|
||||||
import { onChangeAppState } from './state/onChangeAppState.js'
|
import { onChangeAppState } from './state/onChangeAppState.js'
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,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'
|
||||||
|
|
@ -477,7 +476,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)
|
||||||
|
|
@ -7057,3 +7056,4 @@ function extractTeammateOptions(options: unknown): TeammateOptions {
|
||||||
typeof opts.agentType === "string" ? opts.agentType : undefined,
|
typeof opts.agentType === "string" ? opts.agentType : undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,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 */
|
||||||
|
|
|
||||||
|
|
@ -790,8 +790,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,
|
||||||
|
|
@ -2784,7 +2784,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 => {
|
||||||
|
|
@ -3155,8 +3155,7 @@ export function REPL({
|
||||||
const onQueryImpl = useCallback(
|
const onQueryImpl = useCallback(
|
||||||
async (
|
async (
|
||||||
messagesIncludingNewMessages: MessageType[],
|
messagesIncludingNewMessages: MessageType[],
|
||||||
newMessages: MessageType[],
|
_newMessages: MessageType[], abortController: AbortController,
|
||||||
abortController: AbortController,
|
|
||||||
shouldQuery: boolean,
|
shouldQuery: boolean,
|
||||||
additionalAllowedTools: string[],
|
additionalAllowedTools: string[],
|
||||||
mainLoopModelParam: string,
|
mainLoopModelParam: string,
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const ALLOW_BYPASS = !IS_ROOT || !!process.env.IS_SANDBOX
|
||||||
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,
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ import {
|
||||||
getAfkModeHeaderLatched,
|
getAfkModeHeaderLatched,
|
||||||
getCacheEditingHeaderLatched,
|
getCacheEditingHeaderLatched,
|
||||||
getFastModeHeaderLatched,
|
getFastModeHeaderLatched,
|
||||||
getLastApiCompletionTimestamp,
|
|
||||||
getPromptCache1hAllowlist,
|
getPromptCache1hAllowlist,
|
||||||
getPromptCache1hEligible,
|
getPromptCache1hEligible,
|
||||||
getSessionId,
|
getSessionId,
|
||||||
|
|
@ -250,7 +249,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'
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import OpenAI from 'openai'
|
import OpenAI from 'openai'
|
||||||
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:
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ export function registerToolResult(state: CachedMCState, toolId: string): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function registerToolMessage(
|
export function registerToolMessage(
|
||||||
state: CachedMCState,
|
_state: CachedMCState,
|
||||||
groupIds: string[],
|
groupIds: string[],
|
||||||
): void {
|
): void {
|
||||||
for (const id of groupIds) {
|
for (const id of groupIds) {
|
||||||
|
|
@ -98,8 +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
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ function estimateMessageTokens(message: Message): number {
|
||||||
*/
|
*/
|
||||||
export function snipCompactIfNeeded(
|
export function snipCompactIfNeeded(
|
||||||
messages: Message[],
|
messages: Message[],
|
||||||
options?: { force?: boolean },
|
_options?: { force?: boolean },
|
||||||
): {
|
): {
|
||||||
messages: Message[]
|
messages: Message[]
|
||||||
executed: boolean
|
executed: boolean
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ import { REPL_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/REPLTool/c
|
||||||
import type {
|
import type {
|
||||||
AssistantMessage,
|
AssistantMessage,
|
||||||
Message,
|
Message,
|
||||||
SystemLocalCommandMessage,
|
|
||||||
SystemMessage,
|
SystemMessage,
|
||||||
} from '../../types/message.js'
|
} from '../../types/message.js'
|
||||||
import { createAbortController } from '../../utils/abortController.js'
|
import { createAbortController } from '../../utils/abortController.js'
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,10 @@ import {
|
||||||
} from '../../utils/auth.js'
|
} from '../../utils/auth.js'
|
||||||
import { lazySchema } from '../../utils/lazySchema.js'
|
import { lazySchema } from '../../utils/lazySchema.js'
|
||||||
import { parsePluginIdentifier } from '../../utils/plugins/pluginIdentifier.js'
|
import { parsePluginIdentifier } from '../../utils/plugins/pluginIdentifier.js'
|
||||||
import { getSettingsForSource } from '../../utils/settings/settings.js'
|
|
||||||
import { escapeXmlAttr } from '../../utils/xml.js'
|
import { escapeXmlAttr } from '../../utils/xml.js'
|
||||||
import {
|
import {
|
||||||
type ChannelAllowlistEntry,
|
type ChannelAllowlistEntry,
|
||||||
getChannelAllowlist,
|
getChannelAllowlist,
|
||||||
isChannelsEnabled,
|
|
||||||
} from './channelAllowlist.js'
|
} from './channelAllowlist.js'
|
||||||
|
|
||||||
export const ChannelMessageNotificationSchema = lazySchema(() =>
|
export const ChannelMessageNotificationSchema = lazySchema(() =>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import React from 'react'
|
|
||||||
import { MCPServerApprovalDialog } from '../components/MCPServerApprovalDialog.js'
|
import { MCPServerApprovalDialog } from '../components/MCPServerApprovalDialog.js'
|
||||||
import { MCPServerMultiselectDialog } from '../components/MCPServerMultiselectDialog.js'
|
import { MCPServerMultiselectDialog } from '../components/MCPServerMultiselectDialog.js'
|
||||||
import type { Root } from '@anthropic/ink'
|
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 { getIsInteractive } from '../../bootstrap/state.js'
|
||||||
import { ManagedSettingsSecurityDialog } from '../../components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.js'
|
import { ManagedSettingsSecurityDialog } from '../../components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.js'
|
||||||
import {
|
import {
|
||||||
|
|
@ -89,3 +88,4 @@ export function handleSecurityCheckResult(
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export async function* runPostToolUseHooks<Input extends AnyObject, Output>(
|
||||||
toolResponse: Output,
|
toolResponse: Output,
|
||||||
requestId: string | undefined,
|
requestId: string | undefined,
|
||||||
mcpServerType: McpServerType,
|
mcpServerType: McpServerType,
|
||||||
mcpServerBaseUrl: string | undefined,
|
_mcpServerBaseUrl: string | undefined,
|
||||||
): AsyncGenerator<PostToolUseHooksResult<Output>> {
|
): AsyncGenerator<PostToolUseHooksResult<Output>> {
|
||||||
const postToolStartTime = Date.now()
|
const postToolStartTime = Date.now()
|
||||||
try {
|
try {
|
||||||
|
|
@ -200,7 +200,7 @@ export async function* runPostToolUseFailureHooks<Input extends AnyObject>(
|
||||||
isInterrupt: boolean | undefined,
|
isInterrupt: boolean | undefined,
|
||||||
requestId: string | undefined,
|
requestId: string | undefined,
|
||||||
mcpServerType: McpServerType,
|
mcpServerType: McpServerType,
|
||||||
mcpServerBaseUrl: string | undefined,
|
_mcpServerBaseUrl: string | undefined,
|
||||||
): AsyncGenerator<
|
): AsyncGenerator<
|
||||||
MessageUpdateLazy<AttachmentMessage | ProgressMessage<HookProgress>>
|
MessageUpdateLazy<AttachmentMessage | ProgressMessage<HookProgress>>
|
||||||
> {
|
> {
|
||||||
|
|
@ -440,7 +440,7 @@ export async function* runPreToolUseHooks(
|
||||||
messageId: string,
|
messageId: string,
|
||||||
requestId: string | undefined,
|
requestId: string | undefined,
|
||||||
mcpServerType: McpServerType,
|
mcpServerType: McpServerType,
|
||||||
mcpServerBaseUrl: string | undefined,
|
_mcpServerBaseUrl: string | undefined,
|
||||||
): AsyncGenerator<
|
): AsyncGenerator<
|
||||||
| {
|
| {
|
||||||
type: 'message'
|
type: 'message'
|
||||||
|
|
|
||||||
|
|
@ -175,9 +175,6 @@ export const hookJSONOutputSchema = lazySchema(() => {
|
||||||
return z.union([asyncHookResponseSchema, syncHookResponseSchema()])
|
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
|
// Type guard function to check if response is sync
|
||||||
export function isSyncHookJSONOutput(
|
export function isSyncHookJSONOutput(
|
||||||
json: HookJSONOutput,
|
json: HookJSONOutput,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
* to avoid circular dependencies.
|
* to avoid circular dependencies.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { feature } from 'bun:bundle'
|
|
||||||
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs'
|
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs'
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
import { FileTooLargeError, readFileInRange } from './readFileInRange.js'
|
import { FileTooLargeError, readFileInRange } from './readFileInRange.js'
|
||||||
import { expandPath } from './path.js'
|
import { expandPath } from './path.js'
|
||||||
import { countCharInString } from './stringUtils.js'
|
import { countCharInString } from './stringUtils.js'
|
||||||
import { count, uniq } from './array.js'
|
import { uniq } from './array.js'
|
||||||
import { getFsImplementation } from './fsOperations.js'
|
import { getFsImplementation } from './fsOperations.js'
|
||||||
import { readdir, stat } from 'fs/promises'
|
import { readdir, stat } from 'fs/promises'
|
||||||
import type { IDESelection } from '../hooks/useIdeSelection.js'
|
import type { IDESelection } from '../hooks/useIdeSelection.js'
|
||||||
|
|
@ -37,9 +37,7 @@ import {
|
||||||
import { getPlanFilePath, getPlan } from './plans.js'
|
import { getPlanFilePath, getPlan } from './plans.js'
|
||||||
import { getConnectedIdeName } from './ide.js'
|
import { getConnectedIdeName } from './ide.js'
|
||||||
import {
|
import {
|
||||||
filterInjectedMemoryFiles,
|
|
||||||
getManagedAndUserConditionalRules,
|
getManagedAndUserConditionalRules,
|
||||||
getMemoryFiles,
|
|
||||||
getMemoryFilesForNestedDirectory,
|
getMemoryFilesForNestedDirectory,
|
||||||
getConditionalRulesForCwdLevelDirectory,
|
getConditionalRulesForCwdLevelDirectory,
|
||||||
type MemoryFileInfo,
|
type MemoryFileInfo,
|
||||||
|
|
@ -63,7 +61,6 @@ import {
|
||||||
isValidImagePaste,
|
isValidImagePaste,
|
||||||
} from 'src/types/textInputTypes.js'
|
} from 'src/types/textInputTypes.js'
|
||||||
import { randomUUID, type UUID } from 'crypto'
|
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 { getSnippetForTwoFileDiff } from '@claude-code-best/builtin-tools/tools/FileEditTool/utils.js'
|
||||||
import type {
|
import type {
|
||||||
ContentBlockParam,
|
ContentBlockParam,
|
||||||
|
|
@ -72,7 +69,6 @@ import type {
|
||||||
} from '@anthropic-ai/sdk/resources/messages.mjs'
|
} from '@anthropic-ai/sdk/resources/messages.mjs'
|
||||||
import { maybeResizeAndDownsampleImageBlock } from './imageResizer.js'
|
import { maybeResizeAndDownsampleImageBlock } from './imageResizer.js'
|
||||||
import type { PastedContent } from './config.js'
|
import type { PastedContent } from './config.js'
|
||||||
import { getGlobalConfig } from './config.js'
|
|
||||||
import {
|
import {
|
||||||
getDefaultSonnetModel,
|
getDefaultSonnetModel,
|
||||||
getDefaultHaikuModel,
|
getDefaultHaikuModel,
|
||||||
|
|
@ -3484,7 +3480,7 @@ async function getAsyncHookResponseAttachments(): Promise<Attachment[]> {
|
||||||
hookName,
|
hookName,
|
||||||
hookEvent,
|
hookEvent,
|
||||||
toolName,
|
toolName,
|
||||||
pluginId,
|
pluginId: _pluginId,
|
||||||
stdout,
|
stdout,
|
||||||
stderr,
|
stderr,
|
||||||
exitCode,
|
exitCode,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import { randomUUID } from 'crypto'
|
import { randomUUID } from 'crypto'
|
||||||
import React from 'react'
|
|
||||||
import { getOriginalCwd, getSessionId } from 'src/bootstrap/state.js'
|
import { getOriginalCwd, getSessionId } from 'src/bootstrap/state.js'
|
||||||
import { checkGate_CACHED_OR_BLOCKING } from 'src/services/analytics/growthbook.js'
|
import { checkGate_CACHED_OR_BLOCKING } from 'src/services/analytics/growthbook.js'
|
||||||
import {
|
import {
|
||||||
|
|
@ -1516,3 +1515,4 @@ export async function archiveRemoteSession(sessionId: string): Promise<void> {
|
||||||
logError(err)
|
logError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user