Move config.ts from utils/ to src/

This commit is contained in:
Mario Zechner 2025-12-09 01:28:06 +01:00
parent 0c1a9c3091
commit 14d99b5f86
15 changed files with 14 additions and 14 deletions

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -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 */