mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-20 23:35:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,4 +1,19 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type ConnectorTextBlock = { type: string; connector_text: string; signature?: string; [key: string]: unknown };
|
||||
export type ConnectorTextDelta = { type: string; connector_text: string; text?: string; thinking?: string; signature?: string; [key: string]: unknown };
|
||||
export const isConnectorTextBlock: (block: unknown) => block is ConnectorTextBlock = (_block): _block is ConnectorTextBlock => false;
|
||||
export type ConnectorTextBlock = {
|
||||
type: string
|
||||
connector_text: string
|
||||
signature?: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type ConnectorTextDelta = {
|
||||
type: string
|
||||
connector_text: string
|
||||
text?: string
|
||||
thinking?: string
|
||||
signature?: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
export const isConnectorTextBlock: (
|
||||
block: unknown,
|
||||
) => block is ConnectorTextBlock = (_block): _block is ConnectorTextBlock =>
|
||||
false
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type FileSuggestionCommandInput = any;
|
||||
export type FileSuggestionCommandInput = any
|
||||
|
||||
17
src/types/global.d.ts
vendored
17
src/types/global.d.ts
vendored
@@ -21,7 +21,9 @@ declare namespace MACRO {
|
||||
// These are referenced inside `MACRO(() => ...)` or `false && ...` blocks.
|
||||
|
||||
// Model resolution (internal)
|
||||
declare function resolveAntModel(model: string): import('../utils/model/antModels.js').AntModel | undefined
|
||||
declare function resolveAntModel(
|
||||
model: string,
|
||||
): import('../utils/model/antModels.js').AntModel | undefined
|
||||
declare function getAntModels(): import('../utils/model/antModels.js').AntModel[]
|
||||
declare function getAntModelOverrideConfig(): {
|
||||
defaultSystemPromptSuffix?: string
|
||||
@@ -31,7 +33,13 @@ declare function getAntModelOverrideConfig(): {
|
||||
// Companion reactions handled by src/buddy/companionReact.ts (direct import)
|
||||
|
||||
// Metrics (internal)
|
||||
type ApiMetricEntry = { ttftMs: number; firstTokenTime: number; lastTokenTime: number; responseLengthBaseline: number; endResponseLength: number }
|
||||
type ApiMetricEntry = {
|
||||
ttftMs: number
|
||||
firstTokenTime: number
|
||||
lastTokenTime: number
|
||||
responseLengthBaseline: number
|
||||
endResponseLength: number
|
||||
}
|
||||
declare const apiMetricsRef: React.RefObject<ApiMetricEntry[]> | null
|
||||
declare function computeTtftText(metrics: ApiMetricEntry[]): string
|
||||
|
||||
@@ -53,7 +61,10 @@ declare const HOOK_TIMING_DISPLAY_THRESHOLD_MS: number
|
||||
declare type T = unknown
|
||||
|
||||
// Tungsten (internal)
|
||||
declare function TungstenPill(props?: { key?: string; selected?: boolean }): JSX.Element | null
|
||||
declare function TungstenPill(props?: {
|
||||
key?: string
|
||||
selected?: boolean
|
||||
}): JSX.Element | null
|
||||
|
||||
// ============================================================================
|
||||
// Build-time constants BUILD_TARGET/BUILD_ENV/INTERFACE_TYPE — removed (zero runtime usage)
|
||||
|
||||
67
src/types/ink-elements.d.ts
vendored
67
src/types/ink-elements.d.ts
vendored
@@ -1,45 +1,52 @@
|
||||
// Type declarations for custom Ink JSX elements
|
||||
// Note: The detailed prop types are defined in ink-jsx.d.ts via React module augmentation.
|
||||
// This file provides the global JSX namespace fallback declarations.
|
||||
import type { ReactNode, Ref } from 'react';
|
||||
import type { ClickEvent, FocusEvent, KeyboardEvent, Styles, TextStyles, DOMElement } from '@anthropic/ink';
|
||||
import type { ReactNode, Ref } from 'react'
|
||||
import type {
|
||||
ClickEvent,
|
||||
FocusEvent,
|
||||
KeyboardEvent,
|
||||
Styles,
|
||||
TextStyles,
|
||||
DOMElement,
|
||||
} from '@anthropic/ink'
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
'ink-box': {
|
||||
ref?: Ref<DOMElement>;
|
||||
tabIndex?: number;
|
||||
autoFocus?: boolean;
|
||||
onClick?: (event: ClickEvent) => void;
|
||||
onFocus?: (event: FocusEvent) => void;
|
||||
onFocusCapture?: (event: FocusEvent) => void;
|
||||
onBlur?: (event: FocusEvent) => void;
|
||||
onBlurCapture?: (event: FocusEvent) => void;
|
||||
onMouseEnter?: () => void;
|
||||
onMouseLeave?: () => void;
|
||||
onKeyDown?: (event: KeyboardEvent) => void;
|
||||
onKeyDownCapture?: (event: KeyboardEvent) => void;
|
||||
style?: Styles;
|
||||
stickyScroll?: boolean;
|
||||
children?: ReactNode;
|
||||
};
|
||||
ref?: Ref<DOMElement>
|
||||
tabIndex?: number
|
||||
autoFocus?: boolean
|
||||
onClick?: (event: ClickEvent) => void
|
||||
onFocus?: (event: FocusEvent) => void
|
||||
onFocusCapture?: (event: FocusEvent) => void
|
||||
onBlur?: (event: FocusEvent) => void
|
||||
onBlurCapture?: (event: FocusEvent) => void
|
||||
onMouseEnter?: () => void
|
||||
onMouseLeave?: () => void
|
||||
onKeyDown?: (event: KeyboardEvent) => void
|
||||
onKeyDownCapture?: (event: KeyboardEvent) => void
|
||||
style?: Styles
|
||||
stickyScroll?: boolean
|
||||
children?: ReactNode
|
||||
}
|
||||
'ink-text': {
|
||||
style?: Styles;
|
||||
textStyles?: TextStyles;
|
||||
children?: ReactNode;
|
||||
};
|
||||
style?: Styles
|
||||
textStyles?: TextStyles
|
||||
children?: ReactNode
|
||||
}
|
||||
'ink-link': {
|
||||
href?: string;
|
||||
children?: ReactNode;
|
||||
};
|
||||
href?: string
|
||||
children?: ReactNode
|
||||
}
|
||||
'ink-raw-ansi': {
|
||||
rawText?: string;
|
||||
rawWidth?: number;
|
||||
rawHeight?: number;
|
||||
};
|
||||
rawText?: string
|
||||
rawWidth?: number
|
||||
rawHeight?: number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
export {}
|
||||
|
||||
65
src/types/ink-jsx.d.ts
vendored
65
src/types/ink-jsx.d.ts
vendored
@@ -8,43 +8,50 @@
|
||||
* This file must be a module (have an import/export) for `declare module`
|
||||
* augmentation to work correctly.
|
||||
*/
|
||||
import type { ReactNode, Ref } from 'react';
|
||||
import type { ClickEvent, FocusEvent, KeyboardEvent, Styles, TextStyles, DOMElement } from '@anthropic/ink';
|
||||
import type { ReactNode, Ref } from 'react'
|
||||
import type {
|
||||
ClickEvent,
|
||||
FocusEvent,
|
||||
KeyboardEvent,
|
||||
Styles,
|
||||
TextStyles,
|
||||
DOMElement,
|
||||
} from '@anthropic/ink'
|
||||
|
||||
declare module 'react' {
|
||||
namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
'ink-box': {
|
||||
ref?: Ref<DOMElement>;
|
||||
tabIndex?: number;
|
||||
autoFocus?: boolean;
|
||||
onClick?: (event: ClickEvent) => void;
|
||||
onFocus?: (event: FocusEvent) => void;
|
||||
onFocusCapture?: (event: FocusEvent) => void;
|
||||
onBlur?: (event: FocusEvent) => void;
|
||||
onBlurCapture?: (event: FocusEvent) => void;
|
||||
onMouseEnter?: () => void;
|
||||
onMouseLeave?: () => void;
|
||||
onKeyDown?: (event: KeyboardEvent) => void;
|
||||
onKeyDownCapture?: (event: KeyboardEvent) => void;
|
||||
style?: Styles;
|
||||
stickyScroll?: boolean;
|
||||
children?: ReactNode;
|
||||
};
|
||||
ref?: Ref<DOMElement>
|
||||
tabIndex?: number
|
||||
autoFocus?: boolean
|
||||
onClick?: (event: ClickEvent) => void
|
||||
onFocus?: (event: FocusEvent) => void
|
||||
onFocusCapture?: (event: FocusEvent) => void
|
||||
onBlur?: (event: FocusEvent) => void
|
||||
onBlurCapture?: (event: FocusEvent) => void
|
||||
onMouseEnter?: () => void
|
||||
onMouseLeave?: () => void
|
||||
onKeyDown?: (event: KeyboardEvent) => void
|
||||
onKeyDownCapture?: (event: KeyboardEvent) => void
|
||||
style?: Styles
|
||||
stickyScroll?: boolean
|
||||
children?: ReactNode
|
||||
}
|
||||
'ink-text': {
|
||||
style?: Styles;
|
||||
textStyles?: TextStyles;
|
||||
children?: ReactNode;
|
||||
};
|
||||
style?: Styles
|
||||
textStyles?: TextStyles
|
||||
children?: ReactNode
|
||||
}
|
||||
'ink-link': {
|
||||
href?: string;
|
||||
children?: ReactNode;
|
||||
};
|
||||
href?: string
|
||||
children?: ReactNode
|
||||
}
|
||||
'ink-raw-ansi': {
|
||||
rawText?: string;
|
||||
rawWidth?: number;
|
||||
rawHeight?: number;
|
||||
};
|
||||
rawText?: string
|
||||
rawWidth?: number
|
||||
rawHeight?: number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
src/types/internal-modules.d.ts
vendored
33
src/types/internal-modules.d.ts
vendored
@@ -7,25 +7,44 @@
|
||||
// ============================================================================
|
||||
// bun:bundle — compile-time macros
|
||||
// ============================================================================
|
||||
declare module "bun:bundle" {
|
||||
export function feature(name: string): boolean;
|
||||
declare module 'bun:bundle' {
|
||||
export function feature(name: string): boolean
|
||||
}
|
||||
|
||||
declare module "bun:ffi" {
|
||||
export function dlopen<T extends Record<string, { args: readonly string[]; returns: string }>>(path: string, symbols: T): { symbols: { [K in keyof T]: (...args: unknown[]) => unknown }; close(): void };
|
||||
declare module 'bun:ffi' {
|
||||
export function dlopen<
|
||||
T extends Record<string, { args: readonly string[]; returns: string }>,
|
||||
>(
|
||||
path: string,
|
||||
symbols: T,
|
||||
): {
|
||||
symbols: { [K in keyof T]: (...args: unknown[]) => unknown }
|
||||
close(): void
|
||||
}
|
||||
}
|
||||
|
||||
// Third-party modules without @types packages
|
||||
declare module 'bidi-js' {
|
||||
function getEmbeddingLevels(text: string, defaultDirection?: string): { paragraphLevel: number; levels: Uint8Array }
|
||||
function getReorderSegments(text: string, embeddingLevels: { paragraphLevel: number; levels: Uint8Array }, start?: number, end?: number): [number, number][]
|
||||
function getEmbeddingLevels(
|
||||
text: string,
|
||||
defaultDirection?: string,
|
||||
): { paragraphLevel: number; levels: Uint8Array }
|
||||
function getReorderSegments(
|
||||
text: string,
|
||||
embeddingLevels: { paragraphLevel: number; levels: Uint8Array },
|
||||
start?: number,
|
||||
end?: number,
|
||||
): [number, number][]
|
||||
function getVisualOrder(reorderSegments: [number, number][]): number[]
|
||||
export { getEmbeddingLevels, getReorderSegments, getVisualOrder }
|
||||
export default { getEmbeddingLevels, getReorderSegments, getVisualOrder }
|
||||
}
|
||||
|
||||
declare module 'asciichart' {
|
||||
function plot(series: number[] | number[][], config?: Record<string, unknown>): string
|
||||
function plot(
|
||||
series: number[] | number[][],
|
||||
config?: Record<string, unknown>,
|
||||
): string
|
||||
export { plot }
|
||||
export default { plot }
|
||||
}
|
||||
|
||||
@@ -64,7 +64,14 @@ export type RenderableMessage =
|
||||
| AssistantMessage
|
||||
| UserMessage
|
||||
| (import('@ant/model-provider').Message & { type: 'system' })
|
||||
| (import('@ant/model-provider').Message & { type: 'attachment'; attachment: { type: string; memories?: { path: string; content: string; mtimeMs: number }[]; [key: string]: unknown } })
|
||||
| (import('@ant/model-provider').Message & {
|
||||
type: 'attachment'
|
||||
attachment: {
|
||||
type: string
|
||||
memories?: { path: string; content: string; mtimeMs: number }[]
|
||||
[key: string]: unknown
|
||||
}
|
||||
})
|
||||
| (import('@ant/model-provider').Message & { type: 'progress' })
|
||||
| import('@ant/model-provider').GroupedToolUseMessage
|
||||
| CollapsedReadSearchGroup
|
||||
|
||||
@@ -7,4 +7,4 @@ export type QueueOperationMessage = {
|
||||
content?: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type QueueOperation = 'enqueue' | 'dequeue' | 'remove' | string;
|
||||
export type QueueOperation = 'enqueue' | 'dequeue' | 'remove' | string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type NotebookCell = any;
|
||||
export type NotebookContent = any;
|
||||
export type NotebookCellOutput = any;
|
||||
export type NotebookCellSource = any;
|
||||
export type NotebookCellSourceOutput = any;
|
||||
export type NotebookOutputImage = any;
|
||||
export type NotebookCellType = any;
|
||||
export type NotebookCell = any
|
||||
export type NotebookContent = any
|
||||
export type NotebookCellOutput = any
|
||||
export type NotebookCellSource = any
|
||||
export type NotebookCellSourceOutput = any
|
||||
export type NotebookOutputImage = any
|
||||
export type NotebookCellType = any
|
||||
|
||||
73
src/types/sdk-stubs.d.ts
vendored
73
src/types/sdk-stubs.d.ts
vendored
@@ -9,7 +9,7 @@
|
||||
// ============================================================================
|
||||
// coreTypes.generated.js — Generated from coreSchemas.ts Zod schemas
|
||||
// ============================================================================
|
||||
declare module "*/sdk/coreTypes.generated.js" {
|
||||
declare module '*/sdk/coreTypes.generated.js' {
|
||||
// Usage & Model
|
||||
export type ModelUsage = {
|
||||
inputTokens: number
|
||||
@@ -32,20 +32,20 @@ declare module "*/sdk/coreTypes.generated.js" {
|
||||
export type McpServerConfigForProcessTransport = {
|
||||
command: string
|
||||
args: string[]
|
||||
type?: "stdio"
|
||||
type?: 'stdio'
|
||||
env?: Record<string, string>
|
||||
} & { scope: string; pluginSource?: string }
|
||||
export type McpServerStatus = {
|
||||
name: string
|
||||
status: "connected" | "disconnected" | "error"
|
||||
status: 'connected' | 'disconnected' | 'error'
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
// Permissions
|
||||
export type PermissionMode = string
|
||||
export type PermissionResult =
|
||||
| { behavior: "allow" }
|
||||
| { behavior: "deny"; message?: string }
|
||||
| { behavior: 'allow' }
|
||||
| { behavior: 'deny'; message?: string }
|
||||
export type PermissionUpdate = {
|
||||
path: string
|
||||
permission: string
|
||||
@@ -91,21 +91,56 @@ declare module "*/sdk/coreTypes.generated.js" {
|
||||
|
||||
// SDK Message types
|
||||
export type SDKMessage = { type: string; [key: string]: unknown }
|
||||
export type SDKUserMessage = { type: "user"; content: unknown; uuid: string; [key: string]: unknown }
|
||||
export type SDKUserMessage = {
|
||||
type: 'user'
|
||||
content: unknown
|
||||
uuid: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKUserMessageReplay = SDKUserMessage
|
||||
export type SDKAssistantMessage = { type: "assistant"; content: unknown; [key: string]: unknown }
|
||||
export type SDKAssistantErrorMessage = { type: "assistant_error"; error: unknown; [key: string]: unknown }
|
||||
export type SDKAssistantMessageError = 'authentication_failed' | 'billing_error' | 'rate_limit' | 'invalid_request' | 'server_error' | 'unknown' | 'max_output_tokens'
|
||||
export type SDKPartialAssistantMessage = { type: "partial_assistant"; [key: string]: unknown }
|
||||
export type SDKResultMessage = { type: "result"; [key: string]: unknown }
|
||||
export type SDKResultSuccess = { type: "result_success"; [key: string]: unknown }
|
||||
export type SDKSystemMessage = { type: "system"; [key: string]: unknown }
|
||||
export type SDKStatusMessage = { type: "status"; [key: string]: unknown }
|
||||
export type SDKToolProgressMessage = { type: "tool_progress"; [key: string]: unknown }
|
||||
export type SDKCompactBoundaryMessage = { type: "compact_boundary"; [key: string]: unknown }
|
||||
export type SDKPermissionDenial = { type: "permission_denial"; [key: string]: unknown }
|
||||
export type SDKRateLimitInfo = { type: "rate_limit"; [key: string]: unknown }
|
||||
export type SDKStatus = "active" | "idle" | "error" | string
|
||||
export type SDKAssistantMessage = {
|
||||
type: 'assistant'
|
||||
content: unknown
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKAssistantErrorMessage = {
|
||||
type: 'assistant_error'
|
||||
error: unknown
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKAssistantMessageError =
|
||||
| 'authentication_failed'
|
||||
| 'billing_error'
|
||||
| 'rate_limit'
|
||||
| 'invalid_request'
|
||||
| 'server_error'
|
||||
| 'unknown'
|
||||
| 'max_output_tokens'
|
||||
export type SDKPartialAssistantMessage = {
|
||||
type: 'partial_assistant'
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKResultMessage = { type: 'result'; [key: string]: unknown }
|
||||
export type SDKResultSuccess = {
|
||||
type: 'result_success'
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKSystemMessage = { type: 'system'; [key: string]: unknown }
|
||||
export type SDKStatusMessage = { type: 'status'; [key: string]: unknown }
|
||||
export type SDKToolProgressMessage = {
|
||||
type: 'tool_progress'
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKCompactBoundaryMessage = {
|
||||
type: 'compact_boundary'
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKPermissionDenial = {
|
||||
type: 'permission_denial'
|
||||
[key: string]: unknown
|
||||
}
|
||||
export type SDKRateLimitInfo = { type: 'rate_limit'; [key: string]: unknown }
|
||||
export type SDKStatus = 'active' | 'idle' | 'error' | string
|
||||
export type SDKSessionInfo = {
|
||||
sessionId: string
|
||||
summary?: string
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type StatusLineCommandInput = any;
|
||||
export type StatusLineCommandInput = any
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type AgentToolProgress = any;
|
||||
export type BashProgress = any;
|
||||
export type MCPProgress = any;
|
||||
export type REPLToolProgress = any;
|
||||
export type SkillToolProgress = any;
|
||||
export type TaskOutputProgress = any;
|
||||
export type ToolProgressData = any;
|
||||
export type WebSearchProgress = any;
|
||||
export type ShellProgress = any;
|
||||
export type PowerShellProgress = any;
|
||||
export type SdkWorkflowProgress = any;
|
||||
export type AgentToolProgress = any
|
||||
export type BashProgress = any
|
||||
export type MCPProgress = any
|
||||
export type REPLToolProgress = any
|
||||
export type SkillToolProgress = any
|
||||
export type TaskOutputProgress = any
|
||||
export type ToolProgressData = any
|
||||
export type WebSearchProgress = any
|
||||
export type ShellProgress = any
|
||||
export type PowerShellProgress = any
|
||||
export type SdkWorkflowProgress = any
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type DeepImmutable<T> = T;
|
||||
export type Permutations<T> = T[];
|
||||
export type DeepImmutable<T> = T
|
||||
export type Permutations<T> = T[]
|
||||
|
||||
Reference in New Issue
Block a user