deleting index.ts files

This commit is contained in:
2026-02-04 21:02:01 -05:00
parent f0609e423e
commit 74b0a0dbab
92 changed files with 385 additions and 2082 deletions

View File

@@ -6,14 +6,14 @@
* All business logic is delegated to chat-tui-service.ts
*/
import type { ChatServiceCallbacks } from "@services/chat-tui-service.ts";
import { onModeChange } from "@commands/components/callbacks/on-mode-change.ts";
import { onLog } from "@commands/components/callbacks/on-log.ts";
import { onToolCall } from "@commands/components/callbacks/on-tool-call.ts";
import { onToolResult } from "@commands/components/callbacks/on-tool-result.ts";
import { onPermissionRequest } from "@commands/components/callbacks/on-permission-request.ts";
import { onLearningDetected } from "@commands/components/callbacks/on-learning-detected.ts";
import executeCommand from "@commands/components/execute/index.ts";
import type { ChatServiceCallbacks } from "@services/chat-tui-service";
import { onModeChange } from "@commands/components/callbacks/on-mode-change";
import { onLog } from "@commands/components/callbacks/on-log";
import { onToolCall } from "@commands/components/callbacks/on-tool-call";
import { onToolResult } from "@commands/components/callbacks/on-tool-result";
import { onPermissionRequest } from "@commands/components/callbacks/on-permission-request";
import { onLearningDetected } from "@commands/components/callbacks/on-learning-detected";
import executeCommand from "@commands/components/execute/index";
export const createCallbacks = (): ChatServiceCallbacks => ({
onModeChange,

View File

@@ -1,7 +1,7 @@
import { v4 as uuidv4 } from "uuid";
import { appStore } from "@tui/index";
import type { LearningResponse } from "@/types/tui";
import type { LearningCandidate } from "@services/learning-service.ts";
import type { LearningCandidate } from "@services/learning-service";
export const onLearningDetected = async (
candidate: LearningCandidate,

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
import { appStore } from "@tui/index.ts";
import { appStore } from "@tui/index";
import { isQuietTool } from "@utils/core/tools";
import type { ToolCallParams } from "@interfaces/ToolCallParams.ts";
import type { ToolCallParams } from "@interfaces/ToolCallParams";
export const onToolCall = (call: ToolCallParams): void => {
appStore.setCurrentToolCall({

View File

@@ -1,9 +1,6 @@
import { appStore } from "@tui/index.ts";
import {
truncateOutput,
detectDiffContent,
} from "@services/chat-tui-service.ts";
import { getThinkingMessage } from "@constants/status-messages.ts";
import { appStore } from "@tui/index";
import { truncateOutput, detectDiffContent } from "@services/chat-tui-service";
import { getThinkingMessage } from "@constants/status-messages";
export const onToolResult = (
success: boolean,

View File

@@ -1,5 +1,5 @@
import chalk from "chalk";
import type { ChatState } from "./state.ts";
import type { ChatState } from "./state";
export const createCleanup = (state: ChatState) => (): void => {
state.isRunning = false;

View File

@@ -1,5 +1,5 @@
import chalk from "chalk";
import { HELP_COMMANDS } from "@constants/help-commands.ts";
import { HELP_COMMANDS } from "@constants/help-commands";
export const showHelp = (): void => {
console.log("\n" + chalk.bold.underline("Commands") + "\n");

View File

@@ -1,5 +1,9 @@
import chalk from "chalk";
import { infoMessage, errorMessage, warningMessage } from "@utils/core/terminal";
import {
infoMessage,
errorMessage,
warningMessage,
} from "@utils/core/terminal";
import {
createSession,
loadSession,
@@ -9,7 +13,7 @@ import {
} 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.ts";
import { getProvider, getProviderStatus } from "@providers/index";
import {
printWelcome,
formatTipLine,
@@ -20,16 +24,16 @@ import {
import {
DEFAULT_SYSTEM_PROMPT,
buildSystemPromptWithRules,
} from "@prompts/index.ts";
import type { ChatOptions } from "@interfaces/ChatOptions.ts";
} from "@prompts/index";
import type { ChatOptions } from "@interfaces/ChatOptions";
import { createInitialState, type ChatState } from "./state.ts";
import { restoreMessagesFromSession } from "./session/restore-messages.ts";
import { addContextFile } from "./context/add-context-file.ts";
import { handleCommand } from "./commands/handle-command.ts";
import { handleInput } from "./messages/handle-input.ts";
import { executePrintMode } from "./print-mode.ts";
import { createCleanup } from "./cleanup.ts";
import { createInitialState, type ChatState } from "./state";
import { restoreMessagesFromSession } from "./session/restore-messages";
import { addContextFile } from "./context/add-context-file";
import { handleCommand } from "./commands/handle-command";
import { handleInput } from "./messages/handle-input";
import { executePrintMode } from "./print-mode";
import { createCleanup } from "./cleanup";
export const execute = async (options: ChatOptions): Promise<void> => {
const config = await getConfig();
@@ -221,4 +225,4 @@ export const execute = async (options: ChatOptions): Promise<void> => {
}
};
export { createInitialState, type ChatState } from "./state.ts";
export { createInitialState, type ChatState } from "./state";

View File

@@ -1,6 +0,0 @@
/**
* MCP chat commands
*/
export { showMCPStatus } from "@commands/components/chat/mcp/show-mcp-status";
export { handleMCP } from "@commands/components/chat/mcp/handle-mcp";

View File

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

View File

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

View File

@@ -5,9 +5,9 @@ import {
errorMessage,
} from "@utils/core/terminal";
import { getConfig } from "@services/core/config";
import { getProvider } from "@providers/index.ts";
import { showModels } from "./show-models.ts";
import type { ChatState } from "../state.ts";
import { getProvider } from "@providers/index";
import { showModels } from "./show-models";
import type { ChatState } from "../state";
export const switchModel = async (
modelName: string,

View File

@@ -10,8 +10,8 @@ import {
getProvider,
getProviderStatus,
getDefaultModel,
} from "@providers/index.ts";
import type { ChatState } from "../state.ts";
} from "@providers/index";
import type { ChatState } from "../state";
export const switchProvider = async (
providerName: string,

View File

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

View File

@@ -1,4 +1,6 @@
import { tui, appStore } from "@tui/index";
import { tui, appStore } from "@tui/app";
import { appStore } from "@tui-solid/context/app";
import { getProviderInfo } from "@services/chat-tui-service";
import { addServer, connectServer } from "@services/mcp/index";
import * as brainService from "@services/brain";
@@ -121,7 +123,9 @@ const defaultHandleMCPAdd = async (data: MCPAddFormData): Promise<void> => {
}
};
const defaultHandleBrainSetJwtToken = async (jwtToken: string): Promise<void> => {
const defaultHandleBrainSetJwtToken = async (
jwtToken: string,
): Promise<void> => {
await brainService.setJwtToken(jwtToken);
const connected = await brainService.connect();
if (connected) {
@@ -187,7 +191,8 @@ export const renderApp = async (props: RenderAppProps): Promise<void> => {
onMCPAdd: props.handleMCPAdd ?? defaultHandleMCPAdd,
onPermissionResponse: props.handlePermissionResponse ?? (() => {}),
onLearningResponse: props.handleLearningResponse ?? (() => {}),
onBrainSetJwtToken: props.handleBrainSetJwtToken ?? defaultHandleBrainSetJwtToken,
onBrainSetJwtToken:
props.handleBrainSetJwtToken ?? defaultHandleBrainSetJwtToken,
onBrainSetApiKey: props.handleBrainSetApiKey ?? defaultHandleBrainSetApiKey,
onBrainLogout: props.handleBrainLogout ?? defaultHandleBrainLogout,
plan: props.plan,

View File

@@ -1,6 +0,0 @@
/**
* Commands Core - Main command handling
*/
export * from "./runner";
export * from "./handlers";