fixing imports

This commit is contained in:
2026-02-04 21:32:30 -05:00
parent 74b0a0dbab
commit db79856b08
166 changed files with 1986 additions and 982 deletions

View File

@@ -1,5 +1,5 @@
import { v4 as uuidv4 } from "uuid";
import { appStore } from "@tui/index";
import { appStore } from "@tui-solid/context/app";
import type { LearningResponse } from "@/types/tui";
import type { LearningCandidate } from "@services/learning-service";

View File

@@ -1,4 +1,4 @@
import { appStore } from "@tui/index";
import { appStore } from "@tui-solid/context/app";
import type { LogType } from "@/types/log";
export const onLog = (

View File

@@ -1,4 +1,4 @@
import { appStore } from "@tui/index";
import { appStore } from "@tui-solid/context/app";
export const onModeChange = (mode: string): void => {
appStore.setMode(mode as Parameters<typeof appStore.setMode>[0]);

View File

@@ -1,4 +1,4 @@
import { appStore } from "@tui/index";
import { appStore } from "@tui-solid/context/app";
import { isQuietTool } from "@utils/core/tools";
import type { ToolCallParams } from "@interfaces/ToolCallParams";

View File

@@ -1,4 +1,4 @@
import { appStore } from "@tui/index";
import { appStore } from "@tui-solid/context/app";
import { truncateOutput, detectDiffContent } from "@services/chat-tui-service";
import { getThinkingMessage } from "@constants/status-messages";

View File

@@ -3,7 +3,11 @@
*/
import chalk from "chalk";
import { errorMessage, infoMessage, warningMessage } from "@utils/core/terminal";
import {
errorMessage,
infoMessage,
warningMessage,
} from "@utils/core/terminal";
import { agentLoader } from "@services/agent-loader";
import type { ChatState } from "@commands/components/chat/state";

View File

@@ -1,6 +1,6 @@
import { saveSession } from "@services/core/session";
import { clearConversation } from "@commands/components/chat/history/clear-conversation";
import { appStore } from "@tui/index";
import { appStore } from "@tui-solid/context/app";
import { showContextFiles } from "@commands/components/chat/context/show-context-files";
import { removeFile } from "@commands/components/chat/context/remove-file";
import { showContext } from "@commands/components/chat/history/show-context";

View File

@@ -1,6 +1,10 @@
import { readFile, stat } from "fs/promises";
import { basename } from "path";
import { warningMessage, successMessage, errorMessage } from "@utils/core/terminal";
import {
warningMessage,
successMessage,
errorMessage,
} from "@utils/core/terminal";
import { addContextFile } from "@services/core/session";
export const loadFile = async (

View File

@@ -12,19 +12,15 @@ import {
setWorkingDirectory,
} from "@services/core/session";
import { getConfig } from "@services/core/config";
import type { Provider as ProviderName, ChatSession } from "@/types/index";
import { getProvider, getProviderStatus } from "@providers/index";
import {
printWelcome,
formatTipLine,
Style,
Theme,
createInputEditor,
} from "@ui/index";
import {
DEFAULT_SYSTEM_PROMPT,
buildSystemPromptWithRules,
} from "@prompts/index";
import type { Provider as ProviderName, ChatSession } from "@/types/common";
import { getProvider } from "@providers/core/registry";
import { getProviderStatus } from "@providers/core/status";
import { printWelcome } from "@ui/banner/menu/print";
import { formatTipLine } from "@ui/tips/render";
import { Style, Theme } from "@constants/styles";
import { createInputEditor } from "@ui/input-editor/core/editor";
import { DEFAULT_SYSTEM_PROMPT } from "@prompts/system/default";
import { buildSystemPromptWithRules } from "@services/rules/prompt";
import type { ChatOptions } from "@interfaces/ChatOptions";
import { createInitialState, type ChatState } from "./state";

View File

@@ -10,17 +10,19 @@ import {
connectAllServers,
disconnectAllServers,
getAllTools,
} from "@services/mcp/manager";
import {
searchServers,
getPopularServers,
installServerById,
getCategoriesWithCounts,
} from "@services/mcp/index";
} from "@services/mcp/registry";
import {
MCP_CATEGORY_LABELS,
MCP_CATEGORY_ICONS,
} from "@constants/mcp-registry";
import { showMCPStatus } from "@commands/components/chat/mcp/show-mcp-status";
import { appStore } from "@tui/index";
import { appStore } from "@tui-solid/context/app";
/**
* Handle MCP subcommands
@@ -45,7 +47,9 @@ export const handleMCP = async (args: string[]): Promise<void> => {
if (!handler) {
console.log(chalk.yellow(`Unknown MCP command: ${subcommand}`));
console.log(
chalk.gray("Available: status, connect, disconnect, tools, add, search, browse, install, popular, categories"),
chalk.gray(
"Available: status, connect, disconnect, tools, add, search, browse, install, popular, categories",
),
);
return;
}
@@ -277,7 +281,9 @@ const handleCategories = async (_args: string[]): Promise<void> => {
for (const { category, count } of categories) {
const icon = MCP_CATEGORY_ICONS[category];
const label = MCP_CATEGORY_LABELS[category];
console.log(`${icon} ${chalk.white(label)} ${chalk.gray(`(${count} servers)`)}`);
console.log(
`${icon} ${chalk.white(label)} ${chalk.gray(`(${count} servers)`)}`,
);
}
console.log();

View File

@@ -8,7 +8,7 @@ import {
getServerInstances,
getAllTools,
isMCPAvailable,
} from "@services/mcp/index";
} from "@services/mcp/manager";
/**
* Display MCP server status

View File

@@ -3,7 +3,11 @@ import { basename, extname } from "path";
import { addMessage } from "@services/core/session";
import { initializePermissions } from "@services/core/permissions";
import { createAgent } from "@services/core/agent";
import { infoMessage, errorMessage, warningMessage } from "@utils/core/terminal";
import {
infoMessage,
errorMessage,
warningMessage,
} from "@utils/core/terminal";
import { getThinkingMessage } from "@constants/status-messages";
import {
detectDebuggingRequest,

View File

@@ -1,6 +1,6 @@
import chalk from "chalk";
import type { Provider as ProviderName } from "@/types/index";
import { getProvider } from "@providers/index";
import type { Provider as ProviderName } from "@/types/common";
import { getProvider } from "@providers/core/registry";
export const showModels = async (
currentProvider: ProviderName,

View File

@@ -1,5 +1,5 @@
import { getConfig } from "@services/core/config";
import { displayProvidersStatus } from "@providers/index";
import { displayProvidersStatus } from "@providers/core/status";
export const showProviders = async (): Promise<void> => {
const config = await getConfig();

View File

@@ -5,7 +5,7 @@ import {
errorMessage,
} from "@utils/core/terminal";
import { getConfig } from "@services/core/config";
import { getProvider } from "@providers/index";
import { getProvider } from "@providers/core/registry";
import { showModels } from "./show-models";
import type { ChatState } from "../state";

View File

@@ -1,4 +1,4 @@
import type { Provider as ProviderName } from "@/types/index";
import type { Provider as ProviderName } from "@/types/common";
import {
errorMessage,
warningMessage,
@@ -6,11 +6,9 @@ import {
successMessage,
} from "@utils/core/terminal";
import { getConfig } from "@services/core/config";
import {
getProvider,
getProviderStatus,
getDefaultModel,
} from "@providers/index";
import { getProvider } from "@providers/core/registry";
import { getProviderStatus } from "@providers/core/status";
import { getDefaultModel } from "@providers/core/chat";
import type { ChatState } from "../state";
export const switchProvider = async (

View File

@@ -1,5 +1,5 @@
import type { ChatSession } from "@/types/index";
import type { Message } from "@providers/index";
import type { ChatSession } from "@/types/common";
import type { Message } from "@/types/providers";
export const restoreMessagesFromSession = (
session: ChatSession,

View File

@@ -1,7 +1,7 @@
import type { Provider as ProviderName } from "@/types/index";
import type { Message } from "@providers/index";
import type { InputEditorInstance } from "@ui/index";
import { DEFAULT_SYSTEM_PROMPT } from "@prompts/index";
import type { Provider as ProviderName } from "@/types/common";
import type { Message } from "@/types/providers";
import type { InputEditorInstance } from "@ui/input-editor/core/editor";
import { DEFAULT_SYSTEM_PROMPT } from "@prompts/system/default";
export interface ChatState {
inputEditor: InputEditorInstance | null;

View File

@@ -6,7 +6,7 @@ import chalk from "chalk";
import { usageStore } from "@stores/core/usage-store";
import { getUserInfo } from "@providers/copilot/auth/credentials";
import { getCopilotUsage } from "@providers/copilot/usage";
import { getProvider } from "@providers/index";
import { getProvider } from "@providers/core/registry";
import { renderUsageBar, renderUnlimitedBar } from "@utils/menu/progress-bar";
import type { ChatState } from "@commands/components/chat/state";
import type { CopilotQuotaDetail } from "@/types/copilot-usage";

View File

@@ -1,4 +1,4 @@
import { tui } from "@tui-solid/index";
import { tui } from "@tui-solid/app";
import { getProviderInfo } from "@services/chat-tui-service";
import type { ChatServiceState } from "@services/chat-tui-service";
import type { AgentConfig } from "@/types/agent-config";

View File

@@ -1,8 +1,7 @@
import { tui, appStore } from "@tui/app";
import { tui } from "@tui-solid/app";
import { appStore } from "@tui-solid/context/app";
import { getProviderInfo } from "@services/chat-tui-service";
import { addServer, connectServer } from "@services/mcp/index";
import { addServer, connectServer } from "@services/mcp/manager";
import * as brainService from "@services/brain";
import type { ChatServiceState } from "@services/chat-tui-service";
import type { AgentConfig } from "@/types/agent-config";

View File

@@ -4,7 +4,7 @@
import { errorMessage } from "@utils/core/terminal";
import { COMMAND_REGISTRY, isValidCommand } from "@commands/handlers/registry";
import type { CommandOptions } from "@/types/index";
import type { CommandOptions } from "@/types/common";
export const handleCommand = async (
command: string,

View File

@@ -3,7 +3,7 @@
*/
import { execute as executeChat } from "@commands/chat";
import type { CommandOptions } from "@/types/index";
import type { CommandOptions } from "@/types/common";
export const handleChat = async (options: CommandOptions): Promise<void> => {
await executeChat(options);

View File

@@ -18,7 +18,7 @@ import type {
CommandOptions,
IntentRequest,
IntentResponse,
} from "@/types/index";
} from "@/types/common";
const classifyIntent = async (
request: IntentRequest,

View File

@@ -16,7 +16,7 @@ import {
VALID_PROVIDERS,
CONFIG_VALIDATION,
} from "@constants/handlers";
import type { CommandOptions, Provider } from "@/types/index";
import type { CommandOptions, Provider } from "@/types/common";
import type { ConfigAction, ConfigKey } from "@/types/handlers";
type ConfigActionHandler = (key?: string, value?: string) => Promise<void>;

View File

@@ -13,7 +13,7 @@ import {
succeedSpinner,
successMessage,
} from "@utils/core/terminal";
import type { CommandOptions } from "@/types/index";
import type { CommandOptions } from "@/types/common";
export const handlePlan = async (options: CommandOptions): Promise<void> => {
const { intent, task, files = [], output } = options;

View File

@@ -3,7 +3,7 @@
*/
import { execute } from "@commands/core/runner";
import type { CommandOptions } from "@/types/index";
import type { CommandOptions } from "@/types/common";
export const handleRun = async (options: CommandOptions): Promise<void> => {
await execute(options);

View File

@@ -3,7 +3,7 @@
*/
import { boxMessage, warningMessage, infoMessage } from "@utils/core/terminal";
import type { CommandOptions } from "@/types/index";
import type { CommandOptions } from "@/types/common";
import { SERVER_INFO } from "@constants/serve";
export const handleServe = async (_options: CommandOptions): Promise<void> => {

View File

@@ -14,7 +14,7 @@ import {
filePath,
} from "@utils/core/terminal";
import { getConfig } from "@services/core/config";
import type { CommandOptions } from "@/types/index";
import type { CommandOptions } from "@/types/common";
export const handleValidate = async (
options: CommandOptions,

View File

@@ -12,7 +12,11 @@
*/
import chalk from "chalk";
import { errorMessage, infoMessage, successMessage } from "@utils/core/terminal";
import {
errorMessage,
infoMessage,
successMessage,
} from "@utils/core/terminal";
import {
initializeMCP,
getMCPConfig,
@@ -24,7 +28,7 @@ import {
disconnectAllServers,
getServerInstances,
getAllTools,
} from "@services/mcp/index";
} from "@services/mcp/manager";
/**
* MCP command handler

View File

@@ -9,7 +9,7 @@ import {
ESTIMATED_TIME_PER_STEP,
} from "@constants/runner";
import { delay } from "@commands/runner/utils";
import type { AgentType, ExecutionPlan, PlanStep } from "@/types/index";
import type { AgentType, ExecutionPlan, PlanStep } from "@/types/common";
export const createPlan = async (
task: string,

View File

@@ -5,7 +5,7 @@
import chalk from "chalk";
import { filePath } from "@utils/core/terminal";
import { STEP_ICONS, DEFAULT_STEP_ICON } from "@constants/runner";
import type { ExecutionPlan, PlanStep } from "@/types/index";
import type { ExecutionPlan, PlanStep } from "@/types/common";
export const getStepIcon = (type: PlanStep["type"]): string =>
STEP_ICONS[type] ?? DEFAULT_STEP_ICON;

View File

@@ -2,11 +2,15 @@
* Plan execution utilities
*/
import { failSpinner, succeedSpinner, startSpinner } from "@utils/core/terminal";
import {
failSpinner,
succeedSpinner,
startSpinner,
} from "@utils/core/terminal";
import { RUNNER_DELAYS } from "@constants/runner";
import { getStepIcon } from "@commands/runner/display-plan";
import { delay } from "@commands/runner/utils";
import type { ExecutionPlan, PlanStep } from "@/types/index";
import type { ExecutionPlan, PlanStep } from "@/types/common";
import type { StepContext } from "@/types/runner";
const executeStep = async (context: StepContext): Promise<void> => {

View File

@@ -19,7 +19,7 @@ import { displayPlan } from "@commands/runner/display-plan";
import { createPlan } from "@commands/runner/create-plan";
import { executePlan } from "@commands/runner/execute-plan";
import { delay } from "@commands/runner/utils";
import type { CommandOptions, AgentType } from "@/types/index";
import type { CommandOptions, AgentType } from "@/types/common";
import type { RunnerOptions } from "@/types/runner";
const parseOptions = (options: CommandOptions): RunnerOptions | null => {