diff --git a/packages/coding-agent/src/cli/args.ts b/packages/coding-agent/src/cli/args.ts index 68360fdc..4a2a0192 100644 --- a/packages/coding-agent/src/cli/args.ts +++ b/packages/coding-agent/src/cli/args.ts @@ -4,8 +4,8 @@ import type { ThinkingLevel } from "@mariozechner/pi-agent-core"; import chalk from "chalk"; +import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../config.js"; import { allTools, type ToolName } from "../core/tools/index.js"; -import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../utils/config.js"; export type Mode = "text" | "json" | "rpc"; diff --git a/packages/coding-agent/src/utils/config.ts b/packages/coding-agent/src/config.ts similarity index 100% rename from packages/coding-agent/src/utils/config.ts rename to packages/coding-agent/src/config.ts diff --git a/packages/coding-agent/src/core/agent-session.ts b/packages/coding-agent/src/core/agent-session.ts index 6159cb26..4a845f0d 100644 --- a/packages/coding-agent/src/core/agent-session.ts +++ b/packages/coding-agent/src/core/agent-session.ts @@ -15,7 +15,7 @@ import type { Agent, AgentEvent, AgentState, AppMessage, Attachment, ThinkingLevel } from "@mariozechner/pi-agent-core"; import type { AssistantMessage, Model } from "@mariozechner/pi-ai"; -import { getModelsPath } from "../utils/config.js"; +import { getModelsPath } from "../config.js"; import { type BashResult, executeBash as executeBashCommand } from "./bash-executor.js"; import { calculateContextTokens, compact, shouldCompact } from "./compaction.js"; import { exportSessionToHtml } from "./export-html.js"; diff --git a/packages/coding-agent/src/core/export-html.ts b/packages/coding-agent/src/core/export-html.ts index 31450281..bc628faf 100644 --- a/packages/coding-agent/src/core/export-html.ts +++ b/packages/coding-agent/src/core/export-html.ts @@ -3,7 +3,7 @@ import type { AssistantMessage, Message, ToolResultMessage, UserMessage } from " import { existsSync, readFileSync, writeFileSync } from "fs"; import { homedir } from "os"; import { basename } from "path"; -import { APP_NAME, VERSION } from "../utils/config.js"; +import { APP_NAME, VERSION } from "../config.js"; import { type BashExecutionMessage, isBashExecutionMessage } from "./messages.js"; import type { SessionManager } from "./session-manager.js"; diff --git a/packages/coding-agent/src/core/model-config.ts b/packages/coding-agent/src/core/model-config.ts index f8f6f8e1..bf65c9d3 100644 --- a/packages/coding-agent/src/core/model-config.ts +++ b/packages/coding-agent/src/core/model-config.ts @@ -2,7 +2,7 @@ import { type Api, getApiKey, getModels, getProviders, type KnownProvider, type import { type Static, Type } from "@sinclair/typebox"; import AjvModule from "ajv"; import { existsSync, readFileSync } from "fs"; -import { getModelsPath } from "../utils/config.js"; +import { getModelsPath } from "../config.js"; import { getOAuthToken, type SupportedOAuthProvider } from "./oauth/index.js"; import { loadOAuthCredentials } from "./oauth/storage.js"; diff --git a/packages/coding-agent/src/core/oauth/storage.ts b/packages/coding-agent/src/core/oauth/storage.ts index b442169a..5aab88ba 100644 --- a/packages/coding-agent/src/core/oauth/storage.ts +++ b/packages/coding-agent/src/core/oauth/storage.ts @@ -1,5 +1,5 @@ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs"; -import { getAgentDir, getOAuthPath } from "../../utils/config.js"; +import { getAgentDir, getOAuthPath } from "../../config.js"; export interface OAuthCredentials { type: "oauth"; diff --git a/packages/coding-agent/src/core/session-manager.ts b/packages/coding-agent/src/core/session-manager.ts index 0fc5aa21..584e48ea 100644 --- a/packages/coding-agent/src/core/session-manager.ts +++ b/packages/coding-agent/src/core/session-manager.ts @@ -2,7 +2,7 @@ import type { AgentState, AppMessage } from "@mariozechner/pi-agent-core"; import { randomBytes } from "crypto"; import { appendFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync } from "fs"; import { join, resolve } from "path"; -import { getAgentDir } from "../utils/config.js"; +import { getAgentDir } from "../config.js"; function uuidv4(): string { const bytes = randomBytes(16); diff --git a/packages/coding-agent/src/core/settings-manager.ts b/packages/coding-agent/src/core/settings-manager.ts index 8311b99e..be507ab4 100644 --- a/packages/coding-agent/src/core/settings-manager.ts +++ b/packages/coding-agent/src/core/settings-manager.ts @@ -1,6 +1,6 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs"; import { dirname, join } from "path"; -import { getAgentDir } from "../utils/config.js"; +import { getAgentDir } from "../config.js"; export interface CompactionSettings { enabled?: boolean; // default: true diff --git a/packages/coding-agent/src/core/slash-commands.ts b/packages/coding-agent/src/core/slash-commands.ts index a399887b..57f37f2d 100644 --- a/packages/coding-agent/src/core/slash-commands.ts +++ b/packages/coding-agent/src/core/slash-commands.ts @@ -1,6 +1,6 @@ import { existsSync, readdirSync, readFileSync } from "fs"; import { join, resolve } from "path"; -import { CONFIG_DIR_NAME, getCommandsDir } from "../utils/config.js"; +import { CONFIG_DIR_NAME, getCommandsDir } from "../config.js"; /** * Represents a custom slash command loaded from a file diff --git a/packages/coding-agent/src/core/system-prompt.ts b/packages/coding-agent/src/core/system-prompt.ts index 1db1ac7d..c622e3b3 100644 --- a/packages/coding-agent/src/core/system-prompt.ts +++ b/packages/coding-agent/src/core/system-prompt.ts @@ -5,7 +5,7 @@ import chalk from "chalk"; import { existsSync, readFileSync } from "fs"; import { join, resolve } from "path"; -import { getAgentDir, getReadmePath } from "../utils/config.js"; +import { getAgentDir, getReadmePath } from "../config.js"; import type { ToolName } from "./tools/index.js"; /** Tool descriptions for system prompt */ diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts index 3733af42..4ad16ffa 100644 --- a/packages/coding-agent/src/main.ts +++ b/packages/coding-agent/src/main.ts @@ -7,6 +7,7 @@ import chalk from "chalk"; import { type Args, parseArgs, printHelp } from "./cli/args.js"; import { processFileArguments } from "./cli/file-processor.js"; import { selectSession } from "./cli/session-picker.js"; +import { getModelsPath, VERSION } from "./config.js"; import { AgentSession } from "./core/agent-session.js"; import { exportFromFile } from "./core/export-html.js"; import { messageTransformer } from "./core/messages.js"; @@ -20,7 +21,6 @@ import { allTools, codingTools } from "./core/tools/index.js"; import { InteractiveMode, runPrintMode, runRpcMode } from "./modes/index.js"; import { initTheme } from "./modes/interactive/theme/theme.js"; import { getChangelogPath, getNewEntries, parseChangelog } from "./utils/changelog.js"; -import { getModelsPath, VERSION } from "./utils/config.js"; import { ensureTool } from "./utils/tools-manager.js"; /** Check npm registry for new version (non-blocking) */ diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts index 5db1f904..7f317041 100644 --- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts +++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts @@ -23,6 +23,7 @@ import { visibleWidth, } from "@mariozechner/pi-tui"; import { exec } from "child_process"; +import { APP_NAME, getDebugLogPath, getOAuthPath } from "../../config.js"; import type { AgentSession } from "../../core/agent-session.js"; import { isBashExecutionMessage } from "../../core/messages.js"; import { invalidateOAuthCache } from "../../core/model-config.js"; @@ -31,7 +32,6 @@ import { getLatestCompactionEntry, SUMMARY_PREFIX, SUMMARY_SUFFIX } from "../../ import type { TruncationResult } from "../../core/tools/truncate.js"; import { getChangelogPath, parseChangelog } from "../../utils/changelog.js"; import { copyToClipboard } from "../../utils/clipboard.js"; -import { APP_NAME, getDebugLogPath, getOAuthPath } from "../../utils/config.js"; import { AssistantMessageComponent } from "./components/assistant-message.js"; import { BashExecutionComponent } from "./components/bash-execution.js"; import { CompactionComponent } from "./components/compaction.js"; diff --git a/packages/coding-agent/src/modes/interactive/theme/theme.ts b/packages/coding-agent/src/modes/interactive/theme/theme.ts index d8d477fc..3b0787d8 100644 --- a/packages/coding-agent/src/modes/interactive/theme/theme.ts +++ b/packages/coding-agent/src/modes/interactive/theme/theme.ts @@ -4,7 +4,7 @@ import type { EditorTheme, MarkdownTheme, SelectListTheme } from "@mariozechner/ import { type Static, Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; import chalk from "chalk"; -import { getCustomThemesDir, getThemesDir } from "../../../utils/config.js"; +import { getCustomThemesDir, getThemesDir } from "../../../config.js"; // ============================================================================ // Types & Schema diff --git a/packages/coding-agent/src/utils/changelog.ts b/packages/coding-agent/src/utils/changelog.ts index 1b13b6b8..79b17d0e 100644 --- a/packages/coding-agent/src/utils/changelog.ts +++ b/packages/coding-agent/src/utils/changelog.ts @@ -96,4 +96,4 @@ export function getNewEntries(entries: ChangelogEntry[], lastVersion: string): C } // Re-export getChangelogPath from paths.ts for convenience -export { getChangelogPath } from "./config.js"; +export { getChangelogPath } from "../config.js"; diff --git a/packages/coding-agent/src/utils/tools-manager.ts b/packages/coding-agent/src/utils/tools-manager.ts index ac5ded04..8111b3d2 100644 --- a/packages/coding-agent/src/utils/tools-manager.ts +++ b/packages/coding-agent/src/utils/tools-manager.ts @@ -5,7 +5,7 @@ import { arch, platform } from "os"; import { join } from "path"; import { Readable } from "stream"; import { finished } from "stream/promises"; -import { APP_NAME, getToolsDir } from "./config.js"; +import { APP_NAME, getToolsDir } from "../config.js"; const TOOLS_DIR = getToolsDir();