refactor(build): migrated imports to path aliases with per-package tsconfig support

- converted relative imports to path aliases ($c/*, $ai/*, $tui/*, etc.) across all packages
- added per-package tsconfig.json with complete path mappings for runtime resolution
- set importModuleSpecifier to non-relative for IDE auto-import preferences
- updated dev script to run from monorepo root for consistent path resolution
This commit is contained in:
can1357
2026-01-23 11:56:32 +01:00
parent 06efb8bd72
commit 7b5af2dd9f
371 changed files with 1370 additions and 1162 deletions
+2 -2
View File
@@ -4,8 +4,8 @@
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
import chalk from "chalk";
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../config";
import { BUILTIN_TOOLS } from "../core/tools/index";
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "$c/config";
import { BUILTIN_TOOLS } from "$c/core/tools/index";
export type Mode = "text" | "json" | "rpc";
+4 -4
View File
@@ -6,10 +6,10 @@
*/
import chalk from "chalk";
import { APP_NAME, getAgentDir } from "../config";
import { SettingsManager } from "../core/settings-manager";
import { SETTINGS_DEFS, type SettingDef } from "../modes/interactive/components/settings-defs";
import { theme } from "../modes/interactive/theme/theme";
import { APP_NAME, getAgentDir } from "$c/config";
import { SettingsManager } from "$c/core/settings-manager";
import { SETTINGS_DEFS, type SettingDef } from "$c/modes/interactive/components/settings-defs";
import { theme } from "$c/modes/interactive/theme/theme";
// =============================================================================
// Types
@@ -6,9 +6,9 @@ import { existsSync, readFileSync, statSync } from "node:fs";
import { resolve } from "node:path";
import type { ImageContent } from "@oh-my-pi/pi-ai";
import chalk from "chalk";
import { resolveReadPath } from "../core/tools/path-utils";
import { formatDimensionNote, resizeImage } from "../utils/image-resize";
import { detectSupportedImageMimeTypeFromFile } from "../utils/mime";
import { resolveReadPath } from "$c/core/tools/path-utils";
import { formatDimensionNote, resizeImage } from "$c/utils/image-resize";
import { detectSupportedImageMimeTypeFromFile } from "$c/utils/mime";
export interface ProcessedFiles {
text: string;
+2 -2
View File
@@ -3,8 +3,8 @@
*/
import type { Api, Model } from "@oh-my-pi/pi-ai";
import type { ModelRegistry } from "../core/model-registry";
import { fuzzyFilter } from "../utils/fuzzy";
import type { ModelRegistry } from "$c/core/model-registry";
import { fuzzyFilter } from "$c/utils/fuzzy";
/**
* Format a number as human-readable (e.g., 200000 -> "200K", 1000000 -> "1M")
+3 -3
View File
@@ -5,9 +5,9 @@
*/
import chalk from "chalk";
import { APP_NAME } from "../config";
import { PluginManager, parseSettingValue, validateSetting } from "../core/plugins/index";
import { theme } from "../modes/interactive/theme/theme";
import { APP_NAME } from "$c/config";
import { PluginManager, parseSettingValue, validateSetting } from "$c/core/plugins/index";
import { theme } from "$c/modes/interactive/theme/theme";
// =============================================================================
// Types
@@ -3,8 +3,8 @@
*/
import { ProcessTerminal, TUI } from "@oh-my-pi/pi-tui";
import type { SessionInfo } from "../core/session-manager";
import { SessionSelectorComponent } from "../modes/interactive/components/session-selector";
import type { SessionInfo } from "$c/core/session-manager";
import { SessionSelectorComponent } from "$c/modes/interactive/components/session-selector";
/** Show TUI session selector and return selected session path or null if cancelled */
export async function selectSession(sessions: SessionInfo[]): Promise<string | null> {
+2 -2
View File
@@ -6,8 +6,8 @@
import { $ } from "bun";
import chalk from "chalk";
import { APP_NAME } from "../config";
import { theme } from "../modes/interactive/theme/theme";
import { APP_NAME } from "$c/config";
import { theme } from "$c/modes/interactive/theme/theme";
export type SetupComponent = "python";
+1 -1
View File
@@ -5,7 +5,7 @@
*/
import chalk from "chalk";
import { APP_NAME } from "../config";
import { APP_NAME } from "$c/config";
// =============================================================================
// Types
+2 -2
View File
@@ -11,8 +11,8 @@ import { dirname } from "node:path";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";
import chalk from "chalk";
import { APP_NAME, VERSION } from "../config";
import { theme } from "../modes/interactive/theme/theme";
import { APP_NAME, VERSION } from "$c/config";
import { theme } from "$c/modes/interactive/theme/theme";
/**
* Detect if we're running as a Bun compiled binary.