refactor: point agent sdk imports at ts source
This commit is contained in:
@@ -178,7 +178,7 @@ import type { MCPServerConnection } from '../services/mcp/types.js'
|
||||
import type {
|
||||
HookEvent,
|
||||
SyncHookJSONOutput,
|
||||
} from 'src/entrypoints/agentSdkTypes.js'
|
||||
} from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import {
|
||||
checkForAsyncHookResponses,
|
||||
removeDeliveredAsyncHooks,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { SDKMessage } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { SDKMessage } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { checkGate_CACHED_OR_BLOCKING } from '../../../services/analytics/growthbook.js'
|
||||
import { isPolicyAllowed } from '../../../services/policyLimits/index.js'
|
||||
import { detectCurrentRepositoryWithHost } from '../../detectRepository.js'
|
||||
|
||||
@@ -2,7 +2,7 @@ import chalk from 'chalk'
|
||||
import { writeSync } from 'fs'
|
||||
import memoize from 'lodash-es/memoize.js'
|
||||
import { onExit } from 'signal-exit'
|
||||
import type { ExitReason } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { ExitReason } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import {
|
||||
getIsInteractive,
|
||||
getIsScrollDraining,
|
||||
|
||||
@@ -106,7 +106,7 @@ import type {
|
||||
ExitReason,
|
||||
SyncHookJSONOutput,
|
||||
AsyncHookJSONOutput,
|
||||
} from 'src/entrypoints/agentSdkTypes.js'
|
||||
} from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { StatusLineCommandInput } from '../types/statusLine.js'
|
||||
import type { ElicitResult } from '@modelcontextprotocol/sdk/types.js'
|
||||
import type { FileSuggestionCommandInput } from '../types/fileSuggestion.js'
|
||||
|
||||
@@ -2,7 +2,7 @@ import type {
|
||||
AsyncHookJSONOutput,
|
||||
HookEvent,
|
||||
SyncHookJSONOutput,
|
||||
} from 'src/entrypoints/agentSdkTypes.js'
|
||||
} from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
import type { ShellCommand } from '../ShellCommand.js'
|
||||
import { invalidateSessionEnvCache } from '../sessionEnvironment.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { randomUUID } from 'crypto'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { query } from '../../query.js'
|
||||
import { logEvent } from '../../services/analytics/index.js'
|
||||
import type { AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS } from '../../services/analytics/metadata.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import axios from 'axios'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { createCombinedAbortSignal } from '../combinedAbortSignal.js'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
import { errorMessage } from '../errors.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { randomUUID } from 'crypto'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { queryModelWithoutStreaming } from '../../services/api/claude.js'
|
||||
import type { ToolUseContext } from '../../Tool.js'
|
||||
import type { Message } from '../../types/message.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import memoize from 'lodash-es/memoize.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { getRegisteredHooks } from '../../bootstrap/state.js'
|
||||
import type { AppState } from '../../state/AppState.js'
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { resolve } from 'path'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { getSessionId } from '../../bootstrap/state.js'
|
||||
import type { AppState } from '../../state/AppState.js'
|
||||
import type { EditableSettingSource } from '../settings/constants.js'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HOOK_EVENTS, type HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import { HOOK_EVENTS, type HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { AppState } from 'src/state/AppState.js'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
import type { HooksSettings } from '../settings/types.js'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HOOK_EVENTS } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import { HOOK_EVENTS } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { AppState } from 'src/state/AppState.js'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
import type { HooksSettings } from '../settings/types.js'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HOOK_EVENTS, type HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import { HOOK_EVENTS, type HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { AppState } from 'src/state/AppState.js'
|
||||
import type { Message } from 'src/types/message.js'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
|
||||
@@ -102,7 +102,7 @@ import type {
|
||||
import type {
|
||||
HookEvent,
|
||||
SDKAssistantMessageError,
|
||||
} from 'src/entrypoints/agentSdkTypes.js'
|
||||
} from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import { EXPLORE_AGENT } from 'src/tools/AgentTool/built-in/exploreAgent.js'
|
||||
import { PLAN_AGENT } from 'src/tools/AgentTool/built-in/planAgent.js'
|
||||
import { areExplorePlanAgentsEnabled } from 'src/tools/AgentTool/builtInAgents.js'
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
SDKCompactBoundaryMessage,
|
||||
SDKMessage,
|
||||
SDKRateLimitInfo,
|
||||
} from 'src/entrypoints/agentSdkTypes.js'
|
||||
} from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { ClaudeAILimits } from 'src/services/claudeAiLimits.js'
|
||||
import { EXIT_PLAN_MODE_V2_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||
import type {
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
ApiKeySource,
|
||||
PermissionMode,
|
||||
SDKMessage,
|
||||
} from 'src/entrypoints/agentSdkTypes.js'
|
||||
} from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import {
|
||||
AGENT_TOOL_NAME,
|
||||
LEGACY_AGENT_TOOL_NAME,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import memoize from 'lodash-es/memoize.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import {
|
||||
clearRegisteredPluginHooks,
|
||||
getRegisteredHooks,
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
getSessionId,
|
||||
isSessionPersistenceDisabled,
|
||||
} from 'src/bootstrap/state.js'
|
||||
import type { SDKMessage } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { SDKMessage } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { CanUseToolFn } from '../hooks/useCanUseTool.js'
|
||||
import { runTools } from '../services/tools/toolOrchestration.js'
|
||||
import { findToolByName, type Tool, type Tools } from '../Tool.js'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { feature } from 'bun:bundle'
|
||||
import { registerHookCallbacks } from '../bootstrap/state.js'
|
||||
import type { HookInput, HookJSONOutput } from '../entrypoints/agentSdkTypes.js'
|
||||
import type { HookInput, HookJSONOutput } from '../entrypoints/agentSdkTypes.ts'
|
||||
import {
|
||||
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
||||
logEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { feature } from 'bun:bundle'
|
||||
import { open } from 'fs/promises'
|
||||
import { basename, dirname, join, sep } from 'path'
|
||||
import type { ModelUsage } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { ModelUsage } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { Entry, TranscriptMessage } from '../types/logs.js'
|
||||
import { logForDebugging } from './debug.js'
|
||||
import { errorMessage, isENOENT } from './errors.js'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { feature } from 'bun:bundle'
|
||||
import { randomBytes } from 'crypto'
|
||||
import { open } from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import type { ModelUsage } from '../entrypoints/agentSdkTypes.js'
|
||||
import type { ModelUsage } from '../entrypoints/agentSdkTypes.ts'
|
||||
import { logForDebugging } from './debug.js'
|
||||
import { getClaudeConfigHomeDir } from './envUtils.js'
|
||||
import { errorMessage } from './errors.js'
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* - Strips tool list and model info from init messages
|
||||
*/
|
||||
|
||||
import type { SDKAssistantMessage } from 'src/entrypoints/agentSdkTypes.js'
|
||||
import type { SDKAssistantMessage } from 'src/entrypoints/agentSdkTypes.ts'
|
||||
import type { StdoutMessage } from 'src/entrypoints/sdk/controlTypes.ts'
|
||||
import { FILE_EDIT_TOOL_NAME } from 'src/tools/FileEditTool/constants.js'
|
||||
import { FILE_READ_TOOL_NAME } from 'src/tools/FileReadTool/prompt.js'
|
||||
|
||||
@@ -9,7 +9,7 @@ import { isPolicyAllowed } from 'src/services/policyLimits/index.js';
|
||||
import { z } from 'zod/v4';
|
||||
import { getTeleportErrors, TeleportError, type TeleportLocalErrorType } from '../components/TeleportError.js';
|
||||
import { getOauthConfig } from '../constants/oauth.js';
|
||||
import type { SDKMessage } from '../entrypoints/agentSdkTypes.js';
|
||||
import type { SDKMessage } from '../entrypoints/agentSdkTypes.ts';
|
||||
import type { Root } from '../ink.js';
|
||||
import { KeybindingSetup } from '../keybindings/KeybindingProviderSetup.js';
|
||||
import { queryHaiku } from '../services/api/claude.js';
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
ToolResultBlockParam,
|
||||
ToolUseBlock,
|
||||
} from '@anthropic-ai/sdk/resources'
|
||||
import type { SDKMessage } from '../../entrypoints/agentSdkTypes.js'
|
||||
import type { SDKMessage } from '../../entrypoints/agentSdkTypes.ts'
|
||||
import { EXIT_PLAN_MODE_V2_TOOL_NAME } from '../../tools/ExitPlanModeTool/constants.js'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
import { sleep } from '../sleep.js'
|
||||
|
||||
Reference in New Issue
Block a user