mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 22:05:50 +00:00
feat: 完成stub
This commit is contained in:
4
src/types/connectorText.ts
Normal file
4
src/types/connectorText.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type ConnectorTextBlock = any;
|
||||
export type ConnectorTextDelta = any;
|
||||
export const isConnectorTextBlock: any = (() => {}) as any;
|
||||
2
src/types/fileSuggestion.ts
Normal file
2
src/types/fileSuggestion.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type FileSuggestionCommandInput = any;
|
||||
61
src/types/global.d.ts
vendored
Normal file
61
src/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Global declarations for compile-time macros and internal-only identifiers
|
||||
* that are eliminated via Bun's MACRO/bundle feature system.
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// MACRO — Bun compile-time macro function (from bun:bundle)
|
||||
// Expands the function body at build time and removes the call in production.
|
||||
// Also supports property access like MACRO.VERSION (compile-time constants).
|
||||
declare namespace MACRO {
|
||||
export const VERSION: string
|
||||
export const BUILD_TIME: string
|
||||
export const FEEDBACK_CHANNEL: string
|
||||
export const ISSUES_EXPLAINER: string
|
||||
export const NATIVE_PACKAGE_URL: string
|
||||
export const PACKAGE_URL: string
|
||||
export const VERSION_CHANGELOG: string
|
||||
}
|
||||
declare function MACRO<T>(fn: () => T): T
|
||||
|
||||
// ============================================================================
|
||||
// Internal Anthropic-only identifiers (dead-code eliminated in open-source)
|
||||
// These are referenced inside `MACRO(() => ...)` or `false && ...` blocks.
|
||||
|
||||
// Model resolution (internal)
|
||||
declare function resolveAntModel(model: string): any
|
||||
declare function getAntModels(): any[]
|
||||
declare function getAntModelOverrideConfig(): {
|
||||
defaultSystemPromptSuffix?: string
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
|
||||
// Companion/buddy observer (internal)
|
||||
declare function fireCompanionObserver(
|
||||
messages: unknown[],
|
||||
callback: (reaction: unknown) => void,
|
||||
): void
|
||||
|
||||
// Metrics (internal)
|
||||
declare const apiMetricsRef: React.RefObject<any[]> | null
|
||||
declare function computeTtftText(metrics: any[]): string
|
||||
|
||||
// Gate/feature system (internal)
|
||||
declare const Gates: Record<string, any>
|
||||
declare function GateOverridesWarning(): JSX.Element | null
|
||||
declare function ExperimentEnrollmentNotice(): JSX.Element | null
|
||||
|
||||
// Hook timing threshold (re-exported from services/tools/toolExecution.ts)
|
||||
declare const HOOK_TIMING_DISPLAY_THRESHOLD_MS: number
|
||||
|
||||
// Ultraplan (internal)
|
||||
declare function UltraplanChoiceDialog(): JSX.Element | null
|
||||
declare function UltraplanLaunchDialog(): JSX.Element | null
|
||||
declare function launchUltraplan(...args: unknown[]): void
|
||||
|
||||
// T — Generic type parameter leaked from React compiler output
|
||||
// (react/compiler-runtime emits compiled JSX that loses generic type params)
|
||||
declare type T = any
|
||||
|
||||
// Tungsten (internal)
|
||||
declare function TungstenPill(): JSX.Element | null
|
||||
122
src/types/internal-modules.d.ts
vendored
Normal file
122
src/types/internal-modules.d.ts
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* Type declarations for internal Anthropic packages that cannot be installed
|
||||
* from public npm. All exports are typed as `any` to suppress errors while
|
||||
* still allowing IDE navigation for the actual source code.
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// bun:bundle — compile-time macros
|
||||
// ============================================================================
|
||||
declare module "bun:bundle" {
|
||||
export function feature(name: string): boolean
|
||||
export function MACRO<T>(fn: () => T): T
|
||||
}
|
||||
|
||||
declare module "bun:ffi" {
|
||||
export function dlopen(path: string, symbols: Record<string, any>): any
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// @ant/claude-for-chrome-mcp
|
||||
// ============================================================================
|
||||
declare module "@ant/claude-for-chrome-mcp" {
|
||||
export const BROWSER_TOOLS: any[]
|
||||
export class ClaudeForChromeContext { }
|
||||
export class Logger { }
|
||||
export type PermissionMode = any
|
||||
export function createClaudeForChromeMcpServer(...args: any[]): any
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// @ant/computer-use-mcp
|
||||
// ============================================================================
|
||||
declare module "@ant/computer-use-mcp" {
|
||||
export const API_RESIZE_PARAMS: any
|
||||
export class ComputerExecutor { }
|
||||
export type ComputerUseSessionContext = any
|
||||
export type CuCallToolResult = any
|
||||
export type CuPermissionRequest = any
|
||||
export type CuPermissionResponse = any
|
||||
export type DEFAULT_GRANT_FLAGS = any
|
||||
export type DisplayGeometry = any
|
||||
export type FrontmostApp = any
|
||||
export type InstalledApp = any
|
||||
export type ResolvePrepareCaptureResult = any
|
||||
export type RunningApp = any
|
||||
export type ScreenshotDims = any
|
||||
export type ScreenshotResult = any
|
||||
export function bindSessionContext(...args: any[]): any
|
||||
export function buildComputerUseTools(...args: any[]): any[]
|
||||
export function createComputerUseMcpServer(...args: any[]): any
|
||||
export const targetImageSize: any
|
||||
}
|
||||
|
||||
declare module "@ant/computer-use-mcp/sentinelApps" {
|
||||
export const sentinelApps: string[]
|
||||
export function getSentinelCategory(appName: string): string | null
|
||||
}
|
||||
|
||||
declare module "@ant/computer-use-mcp/types" {
|
||||
export type ComputerUseConfig = any
|
||||
export type ComputerUseHostAdapter = any
|
||||
export type CoordinateMode = any
|
||||
export type CuPermissionRequest = any
|
||||
export type CuPermissionResponse = any
|
||||
export type CuSubGates = any
|
||||
export type DEFAULT_GRANT_FLAGS = any
|
||||
export type Logger = any
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// @ant/computer-use-input
|
||||
// ============================================================================
|
||||
declare module "@ant/computer-use-input" {
|
||||
export class ComputerUseInput { }
|
||||
export class ComputerUseInputAPI { }
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// @ant/computer-use-swift
|
||||
// ============================================================================
|
||||
declare module "@ant/computer-use-swift" {
|
||||
export class ComputerUseAPI { }
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// @anthropic-ai/mcpb — McpbManifest was renamed
|
||||
// ============================================================================
|
||||
declare module "@anthropic-ai/mcpb" {
|
||||
export type McpbManifest = any
|
||||
export type McpbUserConfigurationOption = any
|
||||
// Re-export whatever is actually available
|
||||
export * from "@anthropic-ai/mcpb"
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// color-diff-napi
|
||||
// ============================================================================
|
||||
declare module "color-diff-napi" {
|
||||
export function diff(a: [number, number, number], b: [number, number, number]): number
|
||||
export type ColorDiff = any
|
||||
export type ColorFile = any
|
||||
export type SyntaxTheme = any
|
||||
export function getSyntaxTheme(): SyntaxTheme
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Internal Anthropic native modules
|
||||
// ============================================================================
|
||||
declare module "audio-capture-napi" {
|
||||
const _: any
|
||||
export default _
|
||||
}
|
||||
|
||||
declare module "image-processor-napi" {
|
||||
const _: any
|
||||
export default _
|
||||
}
|
||||
|
||||
declare module "url-handler-napi" {
|
||||
const _: any
|
||||
export default _
|
||||
}
|
||||
40
src/types/message.ts
Normal file
40
src/types/message.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type Message = any;
|
||||
export type AssistantMessage = any;
|
||||
export type AttachmentMessage<T = any> = any;
|
||||
export type ProgressMessage<T = any> = any;
|
||||
export type SystemLocalCommandMessage = any;
|
||||
export type SystemMessage = any;
|
||||
export type UserMessage = any;
|
||||
export type NormalizedUserMessage = any;
|
||||
export type RequestStartEvent = any;
|
||||
export type StreamEvent = any;
|
||||
export type SystemCompactBoundaryMessage = any;
|
||||
export type TombstoneMessage = any;
|
||||
export type ToolUseSummaryMessage = any;
|
||||
export type MessageOrigin = any;
|
||||
export type CompactMetadata = any;
|
||||
export type SystemAPIErrorMessage = any;
|
||||
export type SystemFileSnapshotMessage = any;
|
||||
export type NormalizedAssistantMessage<T = any> = any;
|
||||
export type NormalizedMessage = any;
|
||||
export type PartialCompactDirection = any;
|
||||
export type StopHookInfo = any;
|
||||
export type SystemAgentsKilledMessage = any;
|
||||
export type SystemApiMetricsMessage = any;
|
||||
export type SystemAwaySummaryMessage = any;
|
||||
export type SystemBridgeStatusMessage = any;
|
||||
export type SystemInformationalMessage = any;
|
||||
export type SystemMemorySavedMessage = any;
|
||||
export type SystemMessageLevel = any;
|
||||
export type SystemMicrocompactBoundaryMessage = any;
|
||||
export type SystemPermissionRetryMessage = any;
|
||||
export type SystemScheduledTaskFireMessage = any;
|
||||
export type SystemStopHookSummaryMessage = any;
|
||||
export type SystemTurnDurationMessage = any;
|
||||
export type GroupedToolUseMessage = any;
|
||||
export type RenderableMessage = any;
|
||||
export type CollapsedReadSearchGroup = any;
|
||||
export type CollapsibleMessage = any;
|
||||
export type HookResultMessage = any;
|
||||
export type SystemThinkingMessage = any;
|
||||
3
src/types/messageQueueTypes.ts
Normal file
3
src/types/messageQueueTypes.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type QueueOperationMessage = any;
|
||||
export type QueueOperation = any;
|
||||
8
src/types/notebook.ts
Normal file
8
src/types/notebook.ts
Normal file
@@ -0,0 +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;
|
||||
3
src/types/react-compiler-runtime.d.ts
vendored
Normal file
3
src/types/react-compiler-runtime.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare module 'react/compiler-runtime' {
|
||||
export function c(size: number): unknown[]
|
||||
}
|
||||
116
src/types/sdk-stubs.d.ts
vendored
Normal file
116
src/types/sdk-stubs.d.ts
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* Stub type declarations for missing SDK modules.
|
||||
*
|
||||
* These modules are referenced in the open-source codebase but their source
|
||||
* is not yet published. All types are exported as `any` to suppress TS errors
|
||||
* while keeping the import/export structure valid.
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// coreTypes.generated.js — Generated from coreSchemas.ts Zod schemas
|
||||
// ============================================================================
|
||||
declare module "*/sdk/coreTypes.generated.js" {
|
||||
// Usage & Model
|
||||
export type ModelUsage = {
|
||||
inputTokens: number
|
||||
outputTokens: number
|
||||
cacheReadInputTokens: number
|
||||
cacheCreationInputTokens: number
|
||||
webSearchRequests: number
|
||||
costUSD: number
|
||||
contextWindow: number
|
||||
maxOutputTokens: number
|
||||
}
|
||||
export type ApiKeySource = string
|
||||
export type ModelInfo = {
|
||||
name: string
|
||||
displayName?: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
// MCP
|
||||
export type McpServerConfigForProcessTransport = {
|
||||
command: string
|
||||
args: string[]
|
||||
type?: "stdio"
|
||||
env?: Record<string, string>
|
||||
} & { scope: string; pluginSource?: string }
|
||||
export type McpServerStatus = {
|
||||
name: string
|
||||
status: "connected" | "disconnected" | "error"
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
// Permissions
|
||||
export type PermissionMode = string
|
||||
export type PermissionResult =
|
||||
| { behavior: "allow" }
|
||||
| { behavior: "deny"; message?: string }
|
||||
export type PermissionUpdate = {
|
||||
path: string
|
||||
permission: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
// Rewind
|
||||
export type RewindFilesResult = {
|
||||
filesChanged: string[]
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
// Hook types
|
||||
export type HookInput = { hook_event_name: string; [key: string]: unknown }
|
||||
export type HookJSONOutput = { [key: string]: unknown }
|
||||
export type AsyncHookJSONOutput = { [key: string]: unknown }
|
||||
export type SyncHookJSONOutput = { [key: string]: unknown }
|
||||
export type PreToolUseHookInput = HookInput & { tool_name: string }
|
||||
export type PostToolUseHookInput = HookInput & { tool_name: string }
|
||||
export type PostToolUseFailureHookInput = HookInput & { tool_name: string }
|
||||
export type PermissionRequestHookInput = HookInput & { tool_name: string }
|
||||
export type PermissionDeniedHookInput = HookInput
|
||||
export type NotificationHookInput = HookInput & { message: string }
|
||||
export type UserPromptSubmitHookInput = HookInput & { prompt: string }
|
||||
export type SessionStartHookInput = HookInput
|
||||
export type SessionEndHookInput = HookInput & { exit_reason: string }
|
||||
export type SetupHookInput = HookInput
|
||||
export type StopHookInput = HookInput
|
||||
export type StopFailureHookInput = HookInput
|
||||
export type SubagentStartHookInput = HookInput
|
||||
export type SubagentStopHookInput = HookInput
|
||||
export type PreCompactHookInput = HookInput
|
||||
export type PostCompactHookInput = HookInput
|
||||
export type TeammateIdleHookInput = HookInput
|
||||
export type TaskCreatedHookInput = HookInput
|
||||
export type TaskCompletedHookInput = HookInput
|
||||
export type ElicitationHookInput = HookInput
|
||||
export type ElicitationResultHookInput = HookInput
|
||||
export type ConfigChangeHookInput = HookInput
|
||||
export type InstructionsLoadedHookInput = HookInput
|
||||
export type CwdChangedHookInput = HookInput & { cwd: string }
|
||||
export type FileChangedHookInput = HookInput & { path: string }
|
||||
|
||||
// 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 SDKUserMessageReplay = SDKUserMessage
|
||||
export type SDKAssistantMessage = { type: "assistant"; content: unknown; [key: string]: unknown }
|
||||
export type SDKAssistantMessageError = { type: "assistant_error"; error: unknown; [key: string]: unknown }
|
||||
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
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
// Account
|
||||
export type AccountInfo = { [key: string]: unknown }
|
||||
}
|
||||
8
src/types/src/entrypoints/agentSdkTypes.ts
Normal file
8
src/types/src/entrypoints/agentSdkTypes.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
// Auto-generated type stub — replace with real implementation
|
||||
export type HookEvent = any;
|
||||
export type HOOK_EVENTS = any;
|
||||
export type HookInput = any;
|
||||
export type PermissionUpdate = any;
|
||||
export type HookJSONOutput = any;
|
||||
export type AsyncHookJSONOutput = any;
|
||||
export type SyncHookJSONOutput = any;
|
||||
2
src/types/src/types/message.ts
Normal file
2
src/types/src/types/message.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Auto-generated type stub — replace with real implementation
|
||||
export type Message = any;
|
||||
2
src/types/src/utils/fileHistory.ts
Normal file
2
src/types/src/utils/fileHistory.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Auto-generated type stub — replace with real implementation
|
||||
export type FileHistorySnapshot = any;
|
||||
2
src/types/src/utils/permissions/PermissionResult.ts
Normal file
2
src/types/src/utils/permissions/PermissionResult.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Auto-generated type stub — replace with real implementation
|
||||
export type PermissionResult = any;
|
||||
2
src/types/src/utils/permissions/PermissionRule.ts
Normal file
2
src/types/src/utils/permissions/PermissionRule.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Auto-generated type stub — replace with real implementation
|
||||
export type permissionBehaviorSchema = any;
|
||||
@@ -0,0 +1,2 @@
|
||||
// Auto-generated type stub — replace with real implementation
|
||||
export type permissionUpdateSchema = any;
|
||||
2
src/types/src/utils/toolResultStorage.ts
Normal file
2
src/types/src/utils/toolResultStorage.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Auto-generated type stub — replace with real implementation
|
||||
export type ContentReplacementRecord = any;
|
||||
2
src/types/statusLine.ts
Normal file
2
src/types/statusLine.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type StatusLineCommandInput = any;
|
||||
12
src/types/tools.ts
Normal file
12
src/types/tools.ts
Normal file
@@ -0,0 +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;
|
||||
3
src/types/utils.ts
Normal file
3
src/types/utils.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// Auto-generated stub — replace with real implementation
|
||||
export type DeepImmutable<T> = T;
|
||||
export type Permutations<T> = T[];
|
||||
Reference in New Issue
Block a user