diff --git a/src/cli/print.ts b/src/cli/print.ts index 93a61c027..9ccdbdf29 100644 --- a/src/cli/print.ts +++ b/src/cli/print.ts @@ -5385,7 +5385,7 @@ async function loadInitialMessages( return { messages: [] } } - result.messages = index >= 0 ? result.messages.slice(0, index + 1) : [] + result.messages = result.messages.slice(0, index + 1) } // Match coordinator mode to the resumed session's mode diff --git a/src/ink/useTerminalNotification.ts b/src/ink/useTerminalNotification.ts index 90e53eb63..0233ee578 100644 --- a/src/ink/useTerminalNotification.ts +++ b/src/ink/useTerminalNotification.ts @@ -111,9 +111,6 @@ export function useTerminalNotification(): TerminalNotification { ), ) break - case null: - // Handled by the if guard above - break } }, [writeRaw], diff --git a/src/query.ts b/src/query.ts index 0028cab08..260897b60 100644 --- a/src/query.ts +++ b/src/query.ts @@ -1,3 +1,4 @@ +import { feature } from 'bun:bundle' // biome-ignore-all assist/source/organizeImports: internal-only import markers must not be reordered import type { ToolResultBlockParam, @@ -144,7 +145,6 @@ import { } from './utils/config.js' import { productionDeps, type QueryDeps } from './query/deps.js' import type { Terminal, Continue } from './query/transitions.js' -import { feature } from 'bun:bundle' import { getCurrentTurnTokenBudget, getTurnOutputTokens, diff --git a/src/services/api/claude.ts b/src/services/api/claude.ts index 745e56080..7c0261b6f 100644 --- a/src/services/api/claude.ts +++ b/src/services/api/claude.ts @@ -1,3 +1,4 @@ +import { feature } from 'bun:bundle' import type { BetaContentBlock, BetaContentBlockParam, @@ -120,7 +121,6 @@ const autoModeStateModule = feature('TRANSCRIPT_CLASSIFIER') ? (require('../../utils/permissions/autoModeState.js') as typeof import('../../utils/permissions/autoModeState.js')) : null -import { feature } from 'bun:bundle' import type { ClientOptions } from '@anthropic-ai/sdk' import { APIError, diff --git a/src/tools.ts b/src/tools.ts index bdbec480b..fb993eab8 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -1,3 +1,4 @@ +import { feature } from 'bun:bundle' // biome-ignore-all assist/source/organizeImports: internal-only import markers must not be reordered import { toolMatchesName, type Tool, type Tools } from './Tool.js' import { AgentTool } from './tools/AgentTool/AgentTool.js' @@ -91,7 +92,6 @@ export { ASYNC_AGENT_ALLOWED_TOOLS, COORDINATOR_MODE_ALLOWED_TOOLS, } from './constants/tools.js' -import { feature } from 'bun:bundle' // Dead code elimination: conditional import for OVERFLOW_TEST_TOOL /* eslint-disable custom-rules/no-process-env-top-level, @typescript-eslint/no-require-imports */ const OverflowTestTool = feature('OVERFLOW_TEST_TOOL') diff --git a/src/utils/attachments.ts b/src/utils/attachments.ts index 93ae931fd..c5d7ee920 100644 --- a/src/utils/attachments.ts +++ b/src/utils/attachments.ts @@ -1,3 +1,4 @@ +import { feature } from 'bun:bundle' // biome-ignore-all assist/source/organizeImports: internal-only import markers must not be reordered import { logEvent, @@ -209,7 +210,6 @@ import { } from './messages.js' import { isHumanTurn } from './messagePredicates.js' import { isEnvTruthy, getClaudeConfigHomeDir } from './envUtils.js' -import { feature } from 'bun:bundle' /* eslint-disable @typescript-eslint/no-require-imports */ const BRIEF_TOOL_NAME: string | null = feature('KAIROS') || feature('KAIROS_BRIEF') diff --git a/src/utils/bash/parser.ts b/src/utils/bash/parser.ts index 603e75ad9..50ad6e02e 100644 --- a/src/utils/bash/parser.ts +++ b/src/utils/bash/parser.ts @@ -65,7 +65,7 @@ export async function parseCommand( if (feature('TREE_SITTER_BASH')) { await ensureParserInitialized() const mod = getParserModule() - logLoadOnce(mod !== null) + logLoadOnce(Boolean(mod)) if (!mod) return null try { @@ -108,7 +108,7 @@ export async function parseCommandRaw( if (feature('TREE_SITTER_BASH') || feature('TREE_SITTER_BASH_SHADOW')) { await ensureParserInitialized() const mod = getParserModule() - logLoadOnce(mod !== null) + logLoadOnce(Boolean(mod)) if (!mod) return null try { const result = mod.parse(command) diff --git a/src/utils/exportRenderer.tsx b/src/utils/exportRenderer.tsx index c1793fed5..3d166aeaf 100644 --- a/src/utils/exportRenderer.tsx +++ b/src/utils/exportRenderer.tsx @@ -513,7 +513,6 @@ function safeJsonValue(value: unknown, seen = new WeakSet()): unknown { if (typeof value === 'bigint') return `${value}n` if (typeof value === 'symbol') return value.toString() if (typeof value === 'function') return '[Function]' - if (typeof value === 'undefined') return null if (value instanceof Date) { return Number.isNaN(value.getTime()) ? null : value.toISOString() diff --git a/src/utils/truncate.ts b/src/utils/truncate.ts index 2e5eaeee1..28560db8b 100644 --- a/src/utils/truncate.ts +++ b/src/utils/truncate.ts @@ -46,11 +46,6 @@ export function truncatePathMiddle(path: string | undefined, maxLength: number): // Result format: directory + "…" + filename const availableForDir = maxLength - 1 - filenameWidth // -1 for ellipsis - if (availableForDir <= 0) { - // No room for directory, just show filename (truncated if needed) - return truncateStartToWidth(filename, maxLength) - } - // Truncate directory and combine const truncatedDir = truncateToWidthNoEllipsis(directory, availableForDir) return truncatedDir + '…' + filename