mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
This reverts commit c445f43f8d.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { stringWidth, wrapAnsi } from '@anthropic/ink'
|
||||
import { stringWidth } from '../ink/stringWidth.js'
|
||||
import { wrapAnsi } from '../ink/wrapAnsi.js'
|
||||
import {
|
||||
firstGrapheme,
|
||||
getGraphemeSegmenter,
|
||||
|
||||
@@ -8,7 +8,7 @@ mock.module("figures", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
mock.module("src/ink.js", () => ({
|
||||
mock.module("src/components/design-system/color.js", () => ({
|
||||
color: (colorKey: string, themeName: string) => (text: string) => text,
|
||||
}));
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
import { deflateSync } from 'zlib'
|
||||
import { stringWidth } from '@anthropic/ink'
|
||||
import { stringWidth } from '../ink/stringWidth.js'
|
||||
import {
|
||||
type AnsiColor,
|
||||
DEFAULT_BG,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { KeyboardShortcutHint } from '@anthropic/ink'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { KeyboardShortcutHint } from '../components/design-system/KeyboardShortcutHint.js'
|
||||
import { Box, Text } from '../ink.js'
|
||||
import { useKeybinding } from '../keybindings/useKeybinding.js'
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
type Logger,
|
||||
type PermissionMode,
|
||||
} from '@ant/claude-for-chrome-mcp'
|
||||
import { initializeAnalyticsSink } from '../../services/analytics/sink.js'
|
||||
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
||||
import { format } from 'util'
|
||||
import { shutdownDatadog } from '../../services/analytics/datadog.js'
|
||||
@@ -14,7 +13,7 @@ import {
|
||||
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
||||
logEvent,
|
||||
} from '../../services/analytics/index.js'
|
||||
|
||||
import { initializeAnalyticsSink } from '../../services/analytics/sink.js'
|
||||
import { getClaudeAIOAuthTokens } from '../auth.js'
|
||||
import { enableConfigs, getGlobalConfig, saveGlobalConfig } from '../config.js'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react'
|
||||
import { MessageResponse } from '../../components/MessageResponse.js'
|
||||
import { supportsHyperlinks } from '@anthropic/ink'
|
||||
import { Link, Text } from '@anthropic/ink'
|
||||
import { supportsHyperlinks } from '../../ink/supports-hyperlinks.js'
|
||||
import { Link, Text } from '../../ink.js'
|
||||
import { renderToolResultMessage as renderDefaultMCPToolResultMessage } from '../../tools/MCPTool/UI.js'
|
||||
import type { MCPToolResult } from '../../utils/mcpValidation.js'
|
||||
import { truncateToWidth } from '../format.js'
|
||||
|
||||
@@ -3,8 +3,8 @@ import { mkdir, readFile, writeFile } from 'fs/promises'
|
||||
import { homedir } from 'os'
|
||||
import { dirname, join } from 'path'
|
||||
import { pathToFileURL } from 'url'
|
||||
import { color } from '@anthropic/ink'
|
||||
import { supportsHyperlinks } from '@anthropic/ink'
|
||||
import { color } from '../components/design-system/color.js'
|
||||
import { supportsHyperlinks } from '../ink/supports-hyperlinks.js'
|
||||
import { logForDebugging } from './debug.js'
|
||||
import { isENOENT } from './errors.js'
|
||||
import { execFileNoThrow } from './execFileNoThrow.js'
|
||||
|
||||
@@ -2,14 +2,13 @@ import {
|
||||
buildComputerUseTools,
|
||||
createComputerUseMcpServer,
|
||||
} from '@ant/computer-use-mcp'
|
||||
import { initializeAnalyticsSink } from '../../services/analytics/sink.js'
|
||||
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
||||
import { ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js'
|
||||
import { homedir } from 'os'
|
||||
|
||||
import { shutdownDatadog } from '../../services/analytics/datadog.js'
|
||||
import { shutdown1PEventLogging } from '../../services/analytics/firstPartyEventLogger.js'
|
||||
|
||||
import { initializeAnalyticsSink } from '../../services/analytics/sink.js'
|
||||
import { enableConfigs } from '../config.js'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
import { filterAppsForDescription } from './appNames.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react'
|
||||
import { MessageResponse } from '../../components/MessageResponse.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import { Text } from '../../ink.js'
|
||||
import { truncateToWidth } from '../format.js'
|
||||
import type { MCPToolResult } from '../mcpValidation.js'
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
* directly — there is no terminal attached.
|
||||
*/
|
||||
|
||||
import { parseDeepLink } from './parseDeepLink.js'
|
||||
import { homedir } from 'os'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
import {
|
||||
@@ -20,7 +19,7 @@ import {
|
||||
} from '../githubRepoPathMapping.js'
|
||||
import { jsonStringify } from '../slowOperations.js'
|
||||
import { readLastFetchTime } from './banner.js'
|
||||
|
||||
import { parseDeepLink } from './parseDeepLink.js'
|
||||
import { MACOS_BUNDLE_ID } from './registerProtocol.js'
|
||||
import { launchInTerminal } from './terminalLauncher.js'
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* Windows — Writes registry keys under HKEY_CURRENT_USER\Software\Classes
|
||||
*/
|
||||
|
||||
import { DEEP_LINK_PROTOCOL } from './parseDeepLink.js'
|
||||
import { promises as fs } from 'fs'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
@@ -29,6 +28,7 @@ import { execFileNoThrow } from '../execFileNoThrow.js'
|
||||
import { getInitialSettings } from '../settings/settings.js'
|
||||
import { which } from '../which.js'
|
||||
import { getUserBinDir, getXDGDataHome } from '../xdg.js'
|
||||
import { DEEP_LINK_PROTOCOL } from './parseDeepLink.js'
|
||||
|
||||
export const MACOS_BUNDLE_ID = 'com.anthropic.claude-code-url-handler'
|
||||
const APP_NAME = 'Claude Code URL Handler'
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from 'child_process'
|
||||
import memoize from 'lodash-es/memoize.js'
|
||||
import { basename } from 'path'
|
||||
import { instances } from '@anthropic/ink'
|
||||
import instances from '../ink/instances.js'
|
||||
import { logForDebugging } from './debug.js'
|
||||
import { whichSync } from './which.js'
|
||||
|
||||
|
||||
@@ -10,7 +10,25 @@ import {
|
||||
getSessionId,
|
||||
isSessionPersistenceDisabled,
|
||||
} from '../bootstrap/state.js'
|
||||
import { DISABLE_KITTY_KEYBOARD, DISABLE_MODIFY_OTHER_KEYS, DBP, DFE, DISABLE_MOUSE_TRACKING, EXIT_ALT_SCREEN, SHOW_CURSOR, CLEAR_ITERM2_PROGRESS, CLEAR_TAB_STATUS, CLEAR_TERMINAL_TITLE, instances, supportsTabStatus, wrapForMultiplexer } from '@anthropic/ink'
|
||||
import instances from '../ink/instances.js'
|
||||
import {
|
||||
DISABLE_KITTY_KEYBOARD,
|
||||
DISABLE_MODIFY_OTHER_KEYS,
|
||||
} from '../ink/termio/csi.js'
|
||||
import {
|
||||
DBP,
|
||||
DFE,
|
||||
DISABLE_MOUSE_TRACKING,
|
||||
EXIT_ALT_SCREEN,
|
||||
SHOW_CURSOR,
|
||||
} from '../ink/termio/dec.js'
|
||||
import {
|
||||
CLEAR_ITERM2_PROGRESS,
|
||||
CLEAR_TAB_STATUS,
|
||||
CLEAR_TERMINAL_TITLE,
|
||||
supportsTabStatus,
|
||||
wrapForMultiplexer,
|
||||
} from '../ink/termio/osc.js'
|
||||
import { shutdownDatadog } from '../services/analytics/datadog.js'
|
||||
import { shutdown1PEventLogging } from '../services/analytics/firstPartyEventLogger.js'
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import { Text } from '../ink.js'
|
||||
|
||||
/**
|
||||
* Inverse-highlight every occurrence of `query` in `text` (case-insensitive).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk'
|
||||
import { supportsHyperlinks } from '@anthropic/ink'
|
||||
import { supportsHyperlinks } from '../ink/supports-hyperlinks.js'
|
||||
|
||||
// OSC 8 hyperlink escape sequences
|
||||
// Format: \e]8;;URL\e\\TEXT\e]8;;\e\\
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TextProps } from '@anthropic/ink'
|
||||
import type { TextProps } from '../ink.js'
|
||||
import {
|
||||
AGENT_COLOR_TO_THEME_COLOR,
|
||||
type AgentColorName,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getDirectConnectServerUrl, getSessionId } from '../bootstrap/state.js'
|
||||
import { stringWidth } from '@anthropic/ink'
|
||||
import { stringWidth } from '../ink/stringWidth.js'
|
||||
import type { LogOption } from '../types/logs.js'
|
||||
import { getSubscriptionName, isClaudeAISubscriber } from './auth.js'
|
||||
import { getCwd } from './cwd.js'
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import chalk from 'chalk'
|
||||
import { marked, type Token, type Tokens } from 'marked'
|
||||
import stripAnsi from 'strip-ansi'
|
||||
import { color } from '@anthropic/ink'
|
||||
import { color } from '../components/design-system/color.js'
|
||||
import { BLOCKQUOTE_BAR } from '../constants/figures.js'
|
||||
import { stringWidth, supportsHyperlinks } from '@anthropic/ink'
|
||||
import { createHyperlink } from '../utils/hyperlink.js'
|
||||
import { stringWidth } from '../ink/stringWidth.js'
|
||||
import { supportsHyperlinks } from '../ink/supports-hyperlinks.js'
|
||||
import type { CliHighlight } from './cliHighlight.js'
|
||||
import { logForDebugging } from './debug.js'
|
||||
|
||||
import { createHyperlink } from './hyperlink.js'
|
||||
import { stripPromptXMLTags } from './messages.js'
|
||||
import type { ThemeName } from './theme.js'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { logEvent } from 'src/services/analytics/index.js'
|
||||
import { Spinner } from '../components/Spinner.js'
|
||||
import { getOauthConfig } from '../constants/oauth.js'
|
||||
import { useTimeout } from '../hooks/useTimeout.js'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { Box, Text } from '../ink.js'
|
||||
import { getSSLErrorHint } from '../services/api/errorUtils.js'
|
||||
import { getUserAgent } from './http.js'
|
||||
import { logError } from './log.js'
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
formatPastedTextRef,
|
||||
getPastedTextRefNumLines,
|
||||
} from '../history.js'
|
||||
import { instances } from '@anthropic/ink'
|
||||
import instances from '../ink/instances.js'
|
||||
import type { PastedContent } from './config.js'
|
||||
import { classifyGuiEditor, getExternalEditor } from './editor.js'
|
||||
import { execSync_DEPRECATED } from './execSyncWrapper.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { openSync } from 'fs'
|
||||
import { ReadStream } from 'tty'
|
||||
import type { RenderOptions } from '@anthropic/ink'
|
||||
import type { RenderOptions } from '../ink.js'
|
||||
import { isEnvTruthy } from './envUtils.js'
|
||||
import { logError } from './log.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
import { initializeErrorLogSink } from './errorLogSink.js'
|
||||
import { initializeAnalyticsSink } from '../services/analytics/sink.js'
|
||||
import { initializeErrorLogSink } from './errorLogSink.js'
|
||||
|
||||
/**
|
||||
* Attach error log and analytics sinks, draining any events queued before
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
tokenize,
|
||||
undoAnsiCodes,
|
||||
} from '@alcalzone/ansi-tokenize'
|
||||
import { stringWidth } from '@anthropic/ink'
|
||||
import { stringWidth } from '../ink/stringWidth.js'
|
||||
|
||||
// A code is an "end code" if its code equals its endCode (e.g., hyperlink close)
|
||||
function isEndCode(code: AnsiCode): boolean {
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from 'react'
|
||||
import { useLayoutEffect } from 'react'
|
||||
import { PassThrough } from 'stream'
|
||||
import stripAnsi from 'strip-ansi'
|
||||
import { wrappedRender as render, useApp } from '@anthropic/ink'
|
||||
import { render, useApp } from '../ink.js'
|
||||
|
||||
// This is a workaround for the fact that Ink doesn't support multiple <Static>
|
||||
// components in the same render tree. Instead of using a <Static> we just render
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk'
|
||||
import figures from 'figures'
|
||||
import * as React from 'react'
|
||||
import { color, Text } from '@anthropic/ink'
|
||||
import { color, Text } from '../ink.js'
|
||||
import type { MCPServerConnection } from '../services/mcp/types.js'
|
||||
import { getAccountInformation, isClaudeAISubscriber } from './auth.js'
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// biome-ignore-all assist/source/organizeImports: ANT-ONLY import markers must not be reordered
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { Box, Text } from '../ink.js'
|
||||
import * as React from 'react'
|
||||
import {
|
||||
getLargeMemoryFiles,
|
||||
|
||||
@@ -3,11 +3,11 @@ import {
|
||||
type OptionWithDescription,
|
||||
Select,
|
||||
} from '../../components/CustomSelect/index.js'
|
||||
import { Pane } from '@anthropic/ink'
|
||||
import { Pane } from '../../components/design-system/Pane.js'
|
||||
import { Spinner } from '../../components/Spinner.js'
|
||||
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'
|
||||
// eslint-disable-next-line custom-rules/prefer-use-keybindings -- enter to proceed through setup steps
|
||||
import { Box, Text, useInput } from '@anthropic/ink'
|
||||
import { Box, Text, useInput } from '../../ink.js'
|
||||
import { useKeybinding } from '../../keybindings/useKeybinding.js'
|
||||
import {
|
||||
detectPythonPackageManager,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
} from '../components/TeleportError.js'
|
||||
import { getOauthConfig } from '../constants/oauth.js'
|
||||
import type { SDKMessage } from '../entrypoints/agentSdkTypes.js'
|
||||
import type { Root } from '@anthropic/ink'
|
||||
import type { Root } from '../ink.js'
|
||||
import { KeybindingSetup } from '../keybindings/KeybindingProviderSetup.js'
|
||||
import { queryHaiku } from '../services/api/claude.js'
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk'
|
||||
import { ctrlOToExpand } from '../components/CtrlOToExpand.js'
|
||||
import { stringWidth } from '@anthropic/ink'
|
||||
import { stringWidth } from '../ink/stringWidth.js'
|
||||
import sliceAnsi from './sliceAnsi.js'
|
||||
|
||||
// Text rendering utilities for terminal display
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { spawn, spawnSync } from 'child_process'
|
||||
import { getSessionId } from '../bootstrap/state.js'
|
||||
import { instances } from '@anthropic/ink'
|
||||
import instances from '../ink/instances.js'
|
||||
import { registerCleanup } from './cleanupRegistry.js'
|
||||
import { pwd } from './cwd.js'
|
||||
import { logForDebugging } from './debug.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import figures from 'figures'
|
||||
import { color } from '@anthropic/ink'
|
||||
import { color } from '../components/design-system/color.js'
|
||||
import type { Theme, ThemeName } from './theme.js'
|
||||
|
||||
export type TreeNode = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Width-aware truncation/wrapping — needs ink/stringWidth (not leaf-safe).
|
||||
|
||||
import { stringWidth } from '@anthropic/ink'
|
||||
import { stringWidth } from '../ink/stringWidth.js'
|
||||
import { getGraphemeSegmenter } from './intl.js'
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user