diff --git a/package.json b/package.json index 820ea1543..9ea64789c 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "packages/*" ], "scripts": { - "install:dev": "bun install && bun --cwd=packages/coding-agent link && bun --cwd=packages/ai link && bun --cwd=packages/mom link", - "dev": "bun --cwd=packages/coding-agent src/cli.ts", + "install:dev": "bun install && bun --cwd=packages/coding-agent link && bun --cwd=packages/ai link", + "dev": "bun packages/coding-agent/src/cli.ts", "stats": "bun --cwd=packages/coding-agent src/cli.ts stats", "check": "biome check --write . && bun --cwd=packages/coding-agent run check && bun --cwd=packages/omp-stats run check", "fix": "biome check --write --unsafe . && bun --cwd=packages/coding-agent run format-prompts", diff --git a/packages/agent/test/agent-loop.test.ts b/packages/agent/test/agent-loop.test.ts index f3090b9c4..8f6136b28 100644 --- a/packages/agent/test/agent-loop.test.ts +++ b/packages/agent/test/agent-loop.test.ts @@ -8,7 +8,7 @@ import { } from "@oh-my-pi/pi-ai"; import { Type } from "@sinclair/typebox"; import { describe, expect, it } from "vitest"; -import { agentLoop, agentLoopContinue } from "../src/agent-loop"; +import { agentLoop, agentLoopContinue } from "$agent/agent-loop"; import type { AgentContext, AgentEvent, @@ -17,7 +17,7 @@ import type { AgentTool, AgentToolContext, ToolCallContext, -} from "../src/types"; +} from "$agent/types"; // Mock stream for testing - mimics MockAssistantStream class MockAssistantStream extends EventStream { diff --git a/packages/agent/test/agent.test.ts b/packages/agent/test/agent.test.ts index a5e1873ba..1b126bd5c 100644 --- a/packages/agent/test/agent.test.ts +++ b/packages/agent/test/agent.test.ts @@ -7,7 +7,7 @@ import { type Usage, } from "@oh-my-pi/pi-ai"; import { describe, expect, it } from "vitest"; -import { Agent } from "../src/index"; +import { Agent } from "$agent/index"; class MockAssistantStream extends EventStream { constructor() { diff --git a/packages/agent/test/e2e.test.ts b/packages/agent/test/e2e.test.ts index 8ad424568..2037eca8e 100644 --- a/packages/agent/test/e2e.test.ts +++ b/packages/agent/test/e2e.test.ts @@ -1,7 +1,7 @@ import type { AssistantMessage, Model, ToolResultMessage, UserMessage } from "@oh-my-pi/pi-ai"; import { getModel } from "@oh-my-pi/pi-ai"; import { describe, expect, it } from "vitest"; -import { Agent } from "../src/index"; +import { Agent } from "$agent/index"; import { calculateTool } from "./utils/calculate"; async function basicPrompt(model: Model) { diff --git a/packages/agent/test/utils/calculate.ts b/packages/agent/test/utils/calculate.ts index 3231cd9af..c7f40df68 100644 --- a/packages/agent/test/utils/calculate.ts +++ b/packages/agent/test/utils/calculate.ts @@ -1,5 +1,5 @@ import { type Static, Type } from "@sinclair/typebox"; -import type { AgentTool, AgentToolResult } from "../../src/types"; +import type { AgentTool, AgentToolResult } from "$agent/types"; export interface CalculateResult extends AgentToolResult { content: Array<{ type: "text"; text: string }>; diff --git a/packages/agent/test/utils/get-current-time.ts b/packages/agent/test/utils/get-current-time.ts index 097b09c37..dfce23557 100644 --- a/packages/agent/test/utils/get-current-time.ts +++ b/packages/agent/test/utils/get-current-time.ts @@ -1,5 +1,5 @@ import { type Static, Type } from "@sinclair/typebox"; -import type { AgentTool, AgentToolResult } from "../../src/types"; +import type { AgentTool, AgentToolResult } from "$agent/types"; export interface GetCurrentTimeResult extends AgentToolResult<{ utcTimestamp: number }> {} diff --git a/packages/agent/tsconfig.json b/packages/agent/tsconfig.json new file mode 100644 index 000000000..f512af633 --- /dev/null +++ b/packages/agent/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "baseUrl": ".", + "paths": { + "$agent/*": ["./src/*"], + "$ai/*": ["../ai/src/*"], + "$c/*": ["../coding-agent/src/*"], + "$tui/*": ["../tui/src/*"], + "$stats/*": ["../omp-stats/src/*"], + "@oh-my-pi/pi-agent-core": ["./src/index.ts"], + "@oh-my-pi/pi-agent-core/*": ["./src/*"], + "@oh-my-pi/pi-ai": ["../ai/src/index.ts"], + "@oh-my-pi/pi-ai/*": ["../ai/src/*"], + "@oh-my-pi/pi-utils": ["../pi-utils/src/index.ts"], + "@oh-my-pi/pi-utils/*": ["../pi-utils/src/*"], + "@oh-my-pi/pi-coding-agent": ["../coding-agent/src/index.ts"], + "@oh-my-pi/pi-coding-agent/*": ["../coding-agent/src/*"], + "@oh-my-pi/pi-tui": ["../tui/src/index.ts"], + "@oh-my-pi/pi-tui/*": ["../tui/src/*"] + } + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/ai/src/providers/amazon-bedrock.ts b/packages/ai/src/providers/amazon-bedrock.ts index acffc172d..6ae336cd8 100644 --- a/packages/ai/src/providers/amazon-bedrock.ts +++ b/packages/ai/src/providers/amazon-bedrock.ts @@ -18,7 +18,7 @@ import { ToolResultStatus, } from "@aws-sdk/client-bedrock-runtime"; -import { calculateCost } from "../models"; +import { calculateCost } from "$ai/models"; import type { Api, AssistantMessage, @@ -34,10 +34,10 @@ import type { Tool, ToolCall, ToolResultMessage, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { parseStreamingJson } from "../utils/json-parse"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { parseStreamingJson } from "$ai/utils/json-parse"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import { transformMessages } from "./transform-messages"; export interface BedrockOptions extends StreamOptions { diff --git a/packages/ai/src/providers/anthropic.ts b/packages/ai/src/providers/anthropic.ts index 2b3cb6de0..3e32aba74 100644 --- a/packages/ai/src/providers/anthropic.ts +++ b/packages/ai/src/providers/anthropic.ts @@ -4,8 +4,8 @@ import type { MessageCreateParamsStreaming, MessageParam, } from "@anthropic-ai/sdk/resources/messages"; -import { calculateCost } from "../models"; -import { getEnvApiKey, OUTPUT_FALLBACK_BUFFER } from "../stream"; +import { calculateCost } from "$ai/models"; +import { getEnvApiKey, OUTPUT_FALLBACK_BUFFER } from "$ai/stream"; import type { Api, AssistantMessage, @@ -21,11 +21,11 @@ import type { Tool, ToolCall, ToolResultMessage, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { parseStreamingJson } from "../utils/json-parse"; -import { formatErrorMessageWithRetryAfter } from "../utils/retry-after"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { parseStreamingJson } from "$ai/utils/json-parse"; +import { formatErrorMessageWithRetryAfter } from "$ai/utils/retry-after"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import { transformMessages } from "./transform-messages"; diff --git a/packages/ai/src/providers/cursor.ts b/packages/ai/src/providers/cursor.ts index 22a8d63ea..0b8faab0a 100644 --- a/packages/ai/src/providers/cursor.ts +++ b/packages/ai/src/providers/cursor.ts @@ -4,7 +4,7 @@ import http2 from "node:http2"; import { create, fromBinary, fromJson, type JsonValue, toBinary, toJson } from "@bufbuild/protobuf"; import { ValueSchema } from "@bufbuild/protobuf/wkt"; import JSON5 from "json5"; -import { calculateCost } from "../models"; +import { calculateCost } from "$ai/models"; import type { Api, AssistantMessage, @@ -23,10 +23,10 @@ import type { Tool, ToolCall, ToolResultMessage, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { parseStreamingJson } from "../utils/json-parse"; -import { formatErrorMessageWithRetryAfter } from "../utils/retry-after"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { parseStreamingJson } from "$ai/utils/json-parse"; +import { formatErrorMessageWithRetryAfter } from "$ai/utils/retry-after"; import type { McpToolDefinition } from "./cursor/gen/agent_pb"; import { AgentClientMessageSchema, diff --git a/packages/ai/src/providers/google-gemini-cli-usage.ts b/packages/ai/src/providers/google-gemini-cli-usage.ts index 0c2b62cc8..1d658aaf0 100644 --- a/packages/ai/src/providers/google-gemini-cli-usage.ts +++ b/packages/ai/src/providers/google-gemini-cli-usage.ts @@ -6,8 +6,8 @@ import type { UsageProvider, UsageReport, UsageWindow, -} from "../usage"; -import { refreshGoogleCloudToken } from "../utils/oauth/google-gemini-cli"; +} from "$ai/usage"; +import { refreshGoogleCloudToken } from "$ai/utils/oauth/google-gemini-cli"; const DEFAULT_ENDPOINT = "https://cloudcode-pa.googleapis.com"; const CACHE_TTL_MS = 60_000; diff --git a/packages/ai/src/providers/google-gemini-cli.ts b/packages/ai/src/providers/google-gemini-cli.ts index e8d8d30d6..cfeb16cda 100644 --- a/packages/ai/src/providers/google-gemini-cli.ts +++ b/packages/ai/src/providers/google-gemini-cli.ts @@ -7,7 +7,7 @@ import { createHash } from "node:crypto"; import type { Content, ThinkingConfig } from "@google/genai"; import { abortableSleep } from "@oh-my-pi/pi-utils"; -import { calculateCost } from "../models"; +import { calculateCost } from "$ai/models"; import type { Api, AssistantMessage, @@ -18,9 +18,9 @@ import type { TextContent, ThinkingContent, ToolCall, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import { convertMessages, convertTools, diff --git a/packages/ai/src/providers/google-shared.ts b/packages/ai/src/providers/google-shared.ts index 7c65378bd..f11d30659 100644 --- a/packages/ai/src/providers/google-shared.ts +++ b/packages/ai/src/providers/google-shared.ts @@ -3,8 +3,8 @@ */ import { type Content, FinishReason, FunctionCallingConfigMode, type Part, type Schema } from "@google/genai"; -import type { Context, ImageContent, Model, StopReason, TextContent, Tool } from "../types"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +import type { Context, ImageContent, Model, StopReason, TextContent, Tool } from "$ai/types"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import { transformMessages } from "./transform-messages"; type GoogleApiType = "google-generative-ai" | "google-gemini-cli" | "google-vertex"; diff --git a/packages/ai/src/providers/google-vertex.ts b/packages/ai/src/providers/google-vertex.ts index 9be089621..3b1ea7dab 100644 --- a/packages/ai/src/providers/google-vertex.ts +++ b/packages/ai/src/providers/google-vertex.ts @@ -5,7 +5,7 @@ import { type ThinkingConfig, ThinkingLevel, } from "@google/genai"; -import { calculateCost } from "../models"; +import { calculateCost } from "$ai/models"; import type { Api, AssistantMessage, @@ -16,10 +16,10 @@ import type { TextContent, ThinkingContent, ToolCall, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { formatErrorMessageWithRetryAfter } from "../utils/retry-after"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { formatErrorMessageWithRetryAfter } from "$ai/utils/retry-after"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import type { GoogleThinkingLevel } from "./google-gemini-cli"; import { convertMessages, diff --git a/packages/ai/src/providers/google.ts b/packages/ai/src/providers/google.ts index 102d62450..2cf62c2c2 100644 --- a/packages/ai/src/providers/google.ts +++ b/packages/ai/src/providers/google.ts @@ -4,8 +4,8 @@ import { GoogleGenAI, type ThinkingConfig, } from "@google/genai"; -import { calculateCost } from "../models"; -import { getEnvApiKey } from "../stream"; +import { calculateCost } from "$ai/models"; +import { getEnvApiKey } from "$ai/stream"; import type { Api, AssistantMessage, @@ -16,10 +16,10 @@ import type { TextContent, ThinkingContent, ToolCall, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { formatErrorMessageWithRetryAfter } from "../utils/retry-after"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { formatErrorMessageWithRetryAfter } from "$ai/utils/retry-after"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import type { GoogleThinkingLevel } from "./google-gemini-cli"; import { convertMessages, diff --git a/packages/ai/src/providers/openai-codex-responses.ts b/packages/ai/src/providers/openai-codex-responses.ts index 061ee0dfd..1d932c364 100644 --- a/packages/ai/src/providers/openai-codex-responses.ts +++ b/packages/ai/src/providers/openai-codex-responses.ts @@ -9,9 +9,8 @@ import type { ResponseOutputMessage, ResponseReasoningItem, } from "openai/resources/responses/responses"; -import packageJson from "../../package.json" with { type: "json" }; -import { calculateCost } from "../models"; -import { getEnvApiKey } from "../stream"; +import { calculateCost } from "$ai/models"; +import { getEnvApiKey } from "$ai/stream"; import type { Api, AssistantMessage, @@ -24,11 +23,12 @@ import type { ThinkingContent, Tool, ToolCall, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { parseStreamingJson } from "../utils/json-parse"; -import { formatErrorMessageWithRetryAfter } from "../utils/retry-after"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { parseStreamingJson } from "$ai/utils/json-parse"; +import { formatErrorMessageWithRetryAfter } from "$ai/utils/retry-after"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; +import packageJson from "../../package.json" with { type: "json" }; import { CODEX_BASE_URL, JWT_CLAIM_PATH, diff --git a/packages/ai/src/providers/openai-completions.ts b/packages/ai/src/providers/openai-completions.ts index 831c70b68..79ad66edd 100644 --- a/packages/ai/src/providers/openai-completions.ts +++ b/packages/ai/src/providers/openai-completions.ts @@ -8,8 +8,8 @@ import type { ChatCompletionMessageParam, ChatCompletionToolMessageParam, } from "openai/resources/chat/completions"; -import { calculateCost } from "../models"; -import { getEnvApiKey } from "../stream"; +import { calculateCost } from "$ai/models"; +import { getEnvApiKey } from "$ai/stream"; import type { AssistantMessage, Context, @@ -23,11 +23,11 @@ import type { ThinkingContent, Tool, ToolCall, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { parseStreamingJson } from "../utils/json-parse"; -import { formatErrorMessageWithRetryAfter } from "../utils/retry-after"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { parseStreamingJson } from "$ai/utils/json-parse"; +import { formatErrorMessageWithRetryAfter } from "$ai/utils/retry-after"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import { transformMessages } from "./transform-messages"; /** diff --git a/packages/ai/src/providers/openai-responses.ts b/packages/ai/src/providers/openai-responses.ts index 905c4ce93..8e09ed53e 100644 --- a/packages/ai/src/providers/openai-responses.ts +++ b/packages/ai/src/providers/openai-responses.ts @@ -10,8 +10,8 @@ import type { ResponseOutputMessage, ResponseReasoningItem, } from "openai/resources/responses/responses"; -import { calculateCost } from "../models"; -import { getEnvApiKey } from "../stream"; +import { calculateCost } from "$ai/models"; +import { getEnvApiKey } from "$ai/stream"; import type { Api, AssistantMessage, @@ -24,11 +24,11 @@ import type { ThinkingContent, Tool, ToolCall, -} from "../types"; -import { AssistantMessageEventStream } from "../utils/event-stream"; -import { parseStreamingJson } from "../utils/json-parse"; -import { formatErrorMessageWithRetryAfter } from "../utils/retry-after"; -import { sanitizeSurrogates } from "../utils/sanitize-unicode"; +} from "$ai/types"; +import { AssistantMessageEventStream } from "$ai/utils/event-stream"; +import { parseStreamingJson } from "$ai/utils/json-parse"; +import { formatErrorMessageWithRetryAfter } from "$ai/utils/retry-after"; +import { sanitizeSurrogates } from "$ai/utils/sanitize-unicode"; import { transformMessages } from "./transform-messages"; /** Fast deterministic hash to shorten long strings */ diff --git a/packages/ai/src/providers/transform-messages.ts b/packages/ai/src/providers/transform-messages.ts index 43c6fc473..053c15174 100644 --- a/packages/ai/src/providers/transform-messages.ts +++ b/packages/ai/src/providers/transform-messages.ts @@ -1,4 +1,4 @@ -import type { Api, AssistantMessage, Message, Model, ToolCall, ToolResultMessage } from "../types"; +import type { Api, AssistantMessage, Message, Model, ToolCall, ToolResultMessage } from "$ai/types"; /** * Normalize tool call ID for cross-provider compatibility. diff --git a/packages/ai/src/usage/claude.ts b/packages/ai/src/usage/claude.ts index 6becd9d10..977d26df0 100644 --- a/packages/ai/src/usage/claude.ts +++ b/packages/ai/src/usage/claude.ts @@ -7,7 +7,7 @@ import type { UsageReport, UsageStatus, UsageWindow, -} from "../usage"; +} from "$ai/usage"; const DEFAULT_ENDPOINT = "https://api.anthropic.com/api/oauth"; const DEFAULT_CACHE_TTL_MS = 60_000; diff --git a/packages/ai/src/usage/github-copilot.ts b/packages/ai/src/usage/github-copilot.ts index e71c739a2..0bebd08c6 100644 --- a/packages/ai/src/usage/github-copilot.ts +++ b/packages/ai/src/usage/github-copilot.ts @@ -14,7 +14,7 @@ import type { UsageReport, UsageStatus, UsageWindow, -} from "../usage"; +} from "$ai/usage"; const COPILOT_HEADERS = { "User-Agent": "GitHubCopilotChat/0.35.0", diff --git a/packages/ai/src/usage/google-antigravity.ts b/packages/ai/src/usage/google-antigravity.ts index c9b78086b..589a1b016 100644 --- a/packages/ai/src/usage/google-antigravity.ts +++ b/packages/ai/src/usage/google-antigravity.ts @@ -7,8 +7,8 @@ import type { UsageReport, UsageStatus, UsageWindow, -} from "../usage"; -import { refreshAntigravityToken } from "../utils/oauth/google-antigravity"; +} from "$ai/usage"; +import { refreshAntigravityToken } from "$ai/utils/oauth/google-antigravity"; interface AntigravityQuotaInfo { remainingFraction?: number; diff --git a/packages/ai/src/usage/openai-codex.ts b/packages/ai/src/usage/openai-codex.ts index ddfb6293d..167104735 100644 --- a/packages/ai/src/usage/openai-codex.ts +++ b/packages/ai/src/usage/openai-codex.ts @@ -1,5 +1,5 @@ import { Buffer } from "node:buffer"; -import { CODEX_BASE_URL } from "../providers/openai-codex/constants"; +import { CODEX_BASE_URL } from "$ai/providers/openai-codex/constants"; import type { UsageAmount, UsageCache, @@ -9,7 +9,7 @@ import type { UsageProvider, UsageReport, UsageWindow, -} from "../usage"; +} from "$ai/usage"; const CODEX_USAGE_PATH = "wham/usage"; const DEFAULT_CACHE_TTL_MS = 60_000; diff --git a/packages/ai/src/usage/zai.ts b/packages/ai/src/usage/zai.ts index 47531b546..a5f102de9 100644 --- a/packages/ai/src/usage/zai.ts +++ b/packages/ai/src/usage/zai.ts @@ -7,7 +7,7 @@ import type { UsageReport, UsageStatus, UsageWindow, -} from "../usage"; +} from "$ai/usage"; const DEFAULT_ENDPOINT = "https://api.z.ai"; const QUOTA_PATH = "/api/monitor/usage/quota/limit"; diff --git a/packages/ai/src/utils/event-stream.ts b/packages/ai/src/utils/event-stream.ts index 6fb17fe2d..42c0cc4d2 100644 --- a/packages/ai/src/utils/event-stream.ts +++ b/packages/ai/src/utils/event-stream.ts @@ -1,4 +1,4 @@ -import type { AssistantMessage, AssistantMessageEvent } from "../types"; +import type { AssistantMessage, AssistantMessageEvent } from "$ai/types"; // Generic event stream class for async iteration export class EventStream implements AsyncIterable { diff --git a/packages/ai/src/utils/oauth/github-copilot.ts b/packages/ai/src/utils/oauth/github-copilot.ts index 670242b4b..d69ae2c40 100644 --- a/packages/ai/src/utils/oauth/github-copilot.ts +++ b/packages/ai/src/utils/oauth/github-copilot.ts @@ -3,7 +3,7 @@ */ import { abortableSleep } from "@oh-my-pi/pi-utils"; -import { getModels } from "../../models"; +import { getModels } from "$ai/models"; import type { OAuthCredentials } from "./types"; const decode = (s: string) => atob(s); diff --git a/packages/ai/src/utils/overflow.ts b/packages/ai/src/utils/overflow.ts index e21fe5474..a92ea4a16 100644 --- a/packages/ai/src/utils/overflow.ts +++ b/packages/ai/src/utils/overflow.ts @@ -1,4 +1,4 @@ -import type { AssistantMessage } from "../types"; +import type { AssistantMessage } from "$ai/types"; /** * Regex patterns to detect context overflow errors from different providers. diff --git a/packages/ai/src/utils/validation.ts b/packages/ai/src/utils/validation.ts index 8edc69f39..45927a85b 100644 --- a/packages/ai/src/utils/validation.ts +++ b/packages/ai/src/utils/validation.ts @@ -5,7 +5,7 @@ import addFormatsModule from "ajv-formats"; const Ajv = (AjvModule as any).default || AjvModule; const addFormats = (addFormatsModule as any).default || addFormatsModule; -import type { Tool, ToolCall } from "../types"; +import type { Tool, ToolCall } from "$ai/types"; // ============================================================================ // Type Coercion Utilities diff --git a/packages/ai/test/abort.test.ts b/packages/ai/test/abort.test.ts index b19ac86be..a35537ab6 100644 --- a/packages/ai/test/abort.test.ts +++ b/packages/ai/test/abort.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete, stream } from "../src/stream"; -import type { Api, Context, Model, OptionsForApi } from "../src/types"; +import { getModel } from "$ai/models"; +import { complete, stream } from "$ai/stream"; +import type { Api, Context, Model, OptionsForApi } from "$ai/types"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/context-overflow.test.ts b/packages/ai/test/context-overflow.test.ts index 2c17866b0..afca5c667 100644 --- a/packages/ai/test/context-overflow.test.ts +++ b/packages/ai/test/context-overflow.test.ts @@ -14,10 +14,10 @@ import type { ChildProcess } from "node:child_process"; import { execSync, spawn } from "node:child_process"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete } from "../src/stream"; -import type { AssistantMessage, Context, Model, Usage } from "../src/types"; -import { isContextOverflow } from "../src/utils/overflow"; +import { getModel } from "$ai/models"; +import { complete } from "$ai/stream"; +import type { AssistantMessage, Context, Model, Usage } from "$ai/types"; +import { isContextOverflow } from "$ai/utils/overflow"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/duplicate-tool-results.test.ts b/packages/ai/test/duplicate-tool-results.test.ts index 9d6ad7d47..9d6cf0511 100644 --- a/packages/ai/test/duplicate-tool-results.test.ts +++ b/packages/ai/test/duplicate-tool-results.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { transformMessages } from "../src/providers/transform-messages"; -import type { AssistantMessage, Model, ToolResultMessage } from "../src/types"; +import { transformMessages } from "$ai/providers/transform-messages"; +import type { AssistantMessage, Model, ToolResultMessage } from "$ai/types"; /** * Regression test for: "each tool_use must have a single result. Found multiple tool_result blocks with id" diff --git a/packages/ai/test/empty.test.ts b/packages/ai/test/empty.test.ts index 7dbb5eaee..73accc4d3 100644 --- a/packages/ai/test/empty.test.ts +++ b/packages/ai/test/empty.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete } from "../src/stream"; -import type { Api, AssistantMessage, Context, Model, OptionsForApi, UserMessage } from "../src/types"; +import { getModel } from "$ai/models"; +import { complete } from "$ai/stream"; +import type { Api, AssistantMessage, Context, Model, OptionsForApi, UserMessage } from "$ai/types"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/google-thinking-signature.test.ts b/packages/ai/test/google-thinking-signature.test.ts index e7e059ffb..ef30fca3e 100644 --- a/packages/ai/test/google-thinking-signature.test.ts +++ b/packages/ai/test/google-thinking-signature.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { isThinkingPart, retainThoughtSignature } from "../src/providers/google-shared"; +import { isThinkingPart, retainThoughtSignature } from "$ai/providers/google-shared"; describe("Google thinking detection (thoughtSignature)", () => { it("treats part.thought === true as thinking", () => { diff --git a/packages/ai/test/handoff.test.ts b/packages/ai/test/handoff.test.ts index d5ac6145a..c26c221a0 100644 --- a/packages/ai/test/handoff.test.ts +++ b/packages/ai/test/handoff.test.ts @@ -1,8 +1,8 @@ import { Type } from "@sinclair/typebox"; import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete } from "../src/stream"; -import type { Api, AssistantMessage, Context, Message, Model, Tool, ToolResultMessage } from "../src/types"; +import { getModel } from "$ai/models"; +import { complete } from "$ai/stream"; +import type { Api, AssistantMessage, Context, Message, Model, Tool, ToolResultMessage } from "$ai/types"; // Tool for testing const weatherSchema = Type.Object({ diff --git a/packages/ai/test/image-limits.test.ts b/packages/ai/test/image-limits.test.ts index 519713f4a..96d7437bc 100644 --- a/packages/ai/test/image-limits.test.ts +++ b/packages/ai/test/image-limits.test.ts @@ -71,9 +71,9 @@ import { execSync } from "node:child_process"; import { mkdirSync, rmSync } from "node:fs"; import { join } from "node:path"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete } from "../src/stream"; -import type { Api, Context, ImageContent, Model, OptionsForApi, UserMessage } from "../src/types"; +import { getModel } from "$ai/models"; +import { complete } from "$ai/stream"; +import type { Api, Context, ImageContent, Model, OptionsForApi, UserMessage } from "$ai/types"; const TEMP_DIR = join(import.meta.dir, ".temp-images"); diff --git a/packages/ai/test/image-tool-result.test.ts b/packages/ai/test/image-tool-result.test.ts index e0940c44d..bc24c7e6d 100644 --- a/packages/ai/test/image-tool-result.test.ts +++ b/packages/ai/test/image-tool-result.test.ts @@ -2,9 +2,9 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import { Type } from "@sinclair/typebox"; import { describe, expect, it } from "vitest"; -import type { Api, Context, Model, Tool, ToolResultMessage } from "../src/index"; -import { complete, getModel } from "../src/index"; -import type { OptionsForApi } from "../src/types"; +import type { Api, Context, Model, Tool, ToolResultMessage } from "$ai/index"; +import { complete, getModel } from "$ai/index"; +import type { OptionsForApi } from "$ai/types"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/oauth.ts b/packages/ai/test/oauth.ts index f5f361f51..a5a740b47 100644 --- a/packages/ai/test/oauth.ts +++ b/packages/ai/test/oauth.ts @@ -8,8 +8,8 @@ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import { homedir } from "os"; import { dirname, join } from "path"; -import { getOAuthApiKey } from "../src/utils/oauth/index"; -import type { OAuthCredentials, OAuthProvider } from "../src/utils/oauth/types"; +import { getOAuthApiKey } from "$ai/utils/oauth/index"; +import type { OAuthCredentials, OAuthProvider } from "$ai/utils/oauth/types"; const AUTH_PATH = join(homedir(), ".pi", "agent", "auth.json"); diff --git a/packages/ai/test/openai-codex-include.test.ts b/packages/ai/test/openai-codex-include.test.ts index 6ee91bd51..08b0f45da 100644 --- a/packages/ai/test/openai-codex-include.test.ts +++ b/packages/ai/test/openai-codex-include.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { type RequestBody, transformRequestBody } from "../src/providers/openai-codex/request-transformer"; +import { type RequestBody, transformRequestBody } from "$ai/providers/openai-codex/request-transformer"; describe("openai-codex include handling", () => { it("always includes reasoning.encrypted_content when caller include is custom", async () => { diff --git a/packages/ai/test/openai-codex-stream.test.ts b/packages/ai/test/openai-codex-stream.test.ts index d1966e850..03f64e108 100644 --- a/packages/ai/test/openai-codex-stream.test.ts +++ b/packages/ai/test/openai-codex-stream.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from "bun:test"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import { streamOpenAICodexResponses } from "../src/providers/openai-codex-responses"; -import type { Context, Model } from "../src/types"; +import { streamOpenAICodexResponses } from "$ai/providers/openai-codex-responses"; +import type { Context, Model } from "$ai/types"; const originalFetch = global.fetch; const originalAgentDir = process.env.OMP_CODING_AGENT_DIR; diff --git a/packages/ai/test/openai-codex.test.ts b/packages/ai/test/openai-codex.test.ts index 9419cf52a..e15134675 100644 --- a/packages/ai/test/openai-codex.test.ts +++ b/packages/ai/test/openai-codex.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { type RequestBody, transformRequestBody } from "../src/providers/openai-codex/request-transformer"; -import { parseCodexError } from "../src/providers/openai-codex/response-handler"; +import { type RequestBody, transformRequestBody } from "$ai/providers/openai-codex/request-transformer"; +import { parseCodexError } from "$ai/providers/openai-codex/response-handler"; const DEFAULT_PROMPT_PREFIX = "You are an expert coding assistant. You help users with coding tasks by reading files, executing commands"; diff --git a/packages/ai/test/stream.test.ts b/packages/ai/test/stream.test.ts index fe07d9dbe..0ffe3d8f6 100644 --- a/packages/ai/test/stream.test.ts +++ b/packages/ai/test/stream.test.ts @@ -3,10 +3,10 @@ import { readFileSync } from "node:fs"; import { Type } from "@sinclair/typebox"; import { join } from "path"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete, stream } from "../src/stream"; -import type { Api, Context, ImageContent, Model, OptionsForApi, Tool, ToolResultMessage } from "../src/types"; -import { StringEnum } from "../src/utils/typebox-helpers"; +import { getModel } from "$ai/models"; +import { complete, stream } from "$ai/stream"; +import type { Api, Context, ImageContent, Model, OptionsForApi, Tool, ToolResultMessage } from "$ai/types"; +import { StringEnum } from "$ai/utils/typebox-helpers"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/tokens.test.ts b/packages/ai/test/tokens.test.ts index 4ec62efb4..673d797c3 100644 --- a/packages/ai/test/tokens.test.ts +++ b/packages/ai/test/tokens.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { stream } from "../src/stream"; -import type { Api, Context, Model, OptionsForApi } from "../src/types"; +import { getModel } from "$ai/models"; +import { stream } from "$ai/stream"; +import type { Api, Context, Model, OptionsForApi } from "$ai/types"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/tool-argument-coercion.test.ts b/packages/ai/test/tool-argument-coercion.test.ts index 73afd44d4..6be06c1aa 100644 --- a/packages/ai/test/tool-argument-coercion.test.ts +++ b/packages/ai/test/tool-argument-coercion.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; import { Type } from "@sinclair/typebox"; -import type { Tool, ToolCall } from "../src/types"; -import { validateToolArguments } from "../src/utils/validation"; +import type { Tool, ToolCall } from "$ai/types"; +import { validateToolArguments } from "$ai/utils/validation"; describe("Tool argument coercion", () => { it("coerces numeric strings when schema expects number", () => { diff --git a/packages/ai/test/tool-call-without-result.test.ts b/packages/ai/test/tool-call-without-result.test.ts index d3b4ae921..b5eacbf76 100644 --- a/packages/ai/test/tool-call-without-result.test.ts +++ b/packages/ai/test/tool-call-without-result.test.ts @@ -1,8 +1,8 @@ import { Type } from "@sinclair/typebox"; import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete } from "../src/stream"; -import type { Api, Context, Model, OptionsForApi, Tool } from "../src/types"; +import { getModel } from "$ai/models"; +import { complete } from "$ai/stream"; +import type { Api, Context, Model, OptionsForApi, Tool } from "$ai/types"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/total-tokens.test.ts b/packages/ai/test/total-tokens.test.ts index e920b1b7d..ccfd7a61e 100644 --- a/packages/ai/test/total-tokens.test.ts +++ b/packages/ai/test/total-tokens.test.ts @@ -13,9 +13,9 @@ */ import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete } from "../src/stream"; -import type { Api, Context, Model, OptionsForApi, Usage } from "../src/types"; +import { getModel } from "$ai/models"; +import { complete } from "$ai/stream"; +import type { Api, Context, Model, OptionsForApi, Usage } from "$ai/types"; import { resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/ai/test/unicode-surrogate.test.ts b/packages/ai/test/unicode-surrogate.test.ts index ef2efdbfc..9366c55dc 100644 --- a/packages/ai/test/unicode-surrogate.test.ts +++ b/packages/ai/test/unicode-surrogate.test.ts @@ -1,8 +1,8 @@ import { Type } from "@sinclair/typebox"; import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { complete } from "../src/stream"; -import type { Api, Context, Model, OptionsForApi, ToolResultMessage } from "../src/types"; +import { getModel } from "$ai/models"; +import { complete } from "$ai/stream"; +import type { Api, Context, Model, OptionsForApi, ToolResultMessage } from "$ai/types"; import { resolveApiKey } from "./oauth"; // Empty schema for test tools - must be proper OBJECT type for Cloud Code Assist diff --git a/packages/ai/test/xhigh.test.ts b/packages/ai/test/xhigh.test.ts index c88952c26..94e783956 100644 --- a/packages/ai/test/xhigh.test.ts +++ b/packages/ai/test/xhigh.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; -import { getModel } from "../src/models"; -import { stream } from "../src/stream"; -import type { Context, Model } from "../src/types"; +import { getModel } from "$ai/models"; +import { stream } from "$ai/stream"; +import type { Context, Model } from "$ai/types"; function makeContext(): Context { return { diff --git a/packages/ai/test/zen.test.ts b/packages/ai/test/zen.test.ts index ea9c2c2ac..aeaba2ce1 100644 --- a/packages/ai/test/zen.test.ts +++ b/packages/ai/test/zen.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; -import { MODELS } from "../src/models.generated"; -import { complete } from "../src/stream"; -import type { Model } from "../src/types"; +import { MODELS } from "$ai/models.generated"; +import { complete } from "$ai/stream"; +import type { Model } from "$ai/types"; describe.skipIf(!process.env.OPENCODE_API_KEY)("OpenCode Zen Models Smoke Test", () => { const zenModels = Object.values(MODELS.opencode); diff --git a/packages/ai/tsconfig.json b/packages/ai/tsconfig.json new file mode 100644 index 000000000..201b28d15 --- /dev/null +++ b/packages/ai/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "baseUrl": ".", + "paths": { + "$ai/*": ["./src/*"], + "$c/*": ["../coding-agent/src/*"], + "$tui/*": ["../tui/src/*"], + "$agent/*": ["../agent/src/*"], + "$stats/*": ["../omp-stats/src/*"], + "@oh-my-pi/pi-ai": ["./src/index.ts"], + "@oh-my-pi/pi-ai/*": ["./src/*"], + "@oh-my-pi/pi-agent-core": ["../agent/src/index.ts"], + "@oh-my-pi/pi-agent-core/*": ["../agent/src/*"], + "@oh-my-pi/pi-utils": ["../pi-utils/src/index.ts"], + "@oh-my-pi/pi-utils/*": ["../pi-utils/src/*"], + "@oh-my-pi/pi-coding-agent": ["../coding-agent/src/index.ts"], + "@oh-my-pi/pi-coding-agent/*": ["../coding-agent/src/*"], + "@oh-my-pi/pi-tui": ["../tui/src/index.ts"], + "@oh-my-pi/pi-tui/*": ["../tui/src/*"] + } + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/coding-agent/src/cli/args.ts b/packages/coding-agent/src/cli/args.ts index 685b561e3..fd10d62e8 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 "@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"; diff --git a/packages/coding-agent/src/cli/config-cli.ts b/packages/coding-agent/src/cli/config-cli.ts index 29b232b42..57ed445b4 100644 --- a/packages/coding-agent/src/cli/config-cli.ts +++ b/packages/coding-agent/src/cli/config-cli.ts @@ -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 diff --git a/packages/coding-agent/src/cli/file-processor.ts b/packages/coding-agent/src/cli/file-processor.ts index 623544564..7b6f47b5f 100644 --- a/packages/coding-agent/src/cli/file-processor.ts +++ b/packages/coding-agent/src/cli/file-processor.ts @@ -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; diff --git a/packages/coding-agent/src/cli/list-models.ts b/packages/coding-agent/src/cli/list-models.ts index ca8aee8f9..955d1bc0e 100644 --- a/packages/coding-agent/src/cli/list-models.ts +++ b/packages/coding-agent/src/cli/list-models.ts @@ -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") diff --git a/packages/coding-agent/src/cli/plugin-cli.ts b/packages/coding-agent/src/cli/plugin-cli.ts index f5f9e17d9..4a624d343 100644 --- a/packages/coding-agent/src/cli/plugin-cli.ts +++ b/packages/coding-agent/src/cli/plugin-cli.ts @@ -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 diff --git a/packages/coding-agent/src/cli/session-picker.ts b/packages/coding-agent/src/cli/session-picker.ts index 320bee9e6..839ad6ed1 100644 --- a/packages/coding-agent/src/cli/session-picker.ts +++ b/packages/coding-agent/src/cli/session-picker.ts @@ -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 { diff --git a/packages/coding-agent/src/cli/setup-cli.ts b/packages/coding-agent/src/cli/setup-cli.ts index 7a6dc10b4..a9c0ddf63 100644 --- a/packages/coding-agent/src/cli/setup-cli.ts +++ b/packages/coding-agent/src/cli/setup-cli.ts @@ -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"; diff --git a/packages/coding-agent/src/cli/stats-cli.ts b/packages/coding-agent/src/cli/stats-cli.ts index c5e2b9255..f56591772 100644 --- a/packages/coding-agent/src/cli/stats-cli.ts +++ b/packages/coding-agent/src/cli/stats-cli.ts @@ -5,7 +5,7 @@ */ import chalk from "chalk"; -import { APP_NAME } from "../config"; +import { APP_NAME } from "$c/config"; // ============================================================================= // Types diff --git a/packages/coding-agent/src/cli/update-cli.ts b/packages/coding-agent/src/cli/update-cli.ts index 4b8e601eb..0dbc3e127 100644 --- a/packages/coding-agent/src/cli/update-cli.ts +++ b/packages/coding-agent/src/cli/update-cli.ts @@ -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. diff --git a/packages/coding-agent/src/core/agent-session.ts b/packages/coding-agent/src/core/agent-session.ts index fa3e849f0..395719f1f 100644 --- a/packages/coding-agent/src/core/agent-session.ts +++ b/packages/coding-agent/src/core/agent-session.ts @@ -28,10 +28,10 @@ import type { import { isContextOverflow, modelsAreEqual, supportsXhigh } from "@oh-my-pi/pi-ai"; import { abortableSleep, logger } from "@oh-my-pi/pi-utils"; import { YAML } from "bun"; -import type { Rule } from "../capability/rule"; -import { getAgentDbPath } from "../config"; -import { theme } from "../modes/interactive/theme/theme"; -import ttsrInterruptTemplate from "../prompts/system/ttsr-interrupt.md" with { type: "text" }; +import type { Rule } from "$c/capability/rule"; +import { getAgentDbPath } from "$c/config"; +import { theme } from "$c/modes/interactive/theme/theme"; +import ttsrInterruptTemplate from "$c/prompts/system/ttsr-interrupt.md" with { type: "text" }; import { type BashResult, executeBash as executeBashCommand } from "./bash-executor"; import { type CompactionResult, diff --git a/packages/coding-agent/src/core/agent-storage.ts b/packages/coding-agent/src/core/agent-storage.ts index 451aaea05..660865583 100644 --- a/packages/coding-agent/src/core/agent-storage.ts +++ b/packages/coding-agent/src/core/agent-storage.ts @@ -2,7 +2,7 @@ import { Database } from "bun:sqlite"; import { chmodSync, existsSync, mkdirSync } from "node:fs"; import { dirname } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; -import { getAgentDbPath } from "../config"; +import { getAgentDbPath } from "$c/config"; import type { AuthCredential } from "./auth-storage"; import type { Settings } from "./settings-manager"; diff --git a/packages/coding-agent/src/core/auth-storage.ts b/packages/coding-agent/src/core/auth-storage.ts index 70aab8b82..a0d04e48c 100644 --- a/packages/coding-agent/src/core/auth-storage.ts +++ b/packages/coding-agent/src/core/auth-storage.ts @@ -33,7 +33,7 @@ import { zaiUsageProvider, } from "@oh-my-pi/pi-ai"; import { logger } from "@oh-my-pi/pi-utils"; -import { getAgentDbPath, getAuthPath } from "../config"; +import { getAgentDbPath, getAuthPath } from "$c/config"; import { AgentStorage } from "./agent-storage"; import { migrateJsonStorage } from "./storage-migration"; diff --git a/packages/coding-agent/src/core/bash-executor.ts b/packages/coding-agent/src/core/bash-executor.ts index 213f03d79..968fece12 100644 --- a/packages/coding-agent/src/core/bash-executor.ts +++ b/packages/coding-agent/src/core/bash-executor.ts @@ -5,8 +5,8 @@ */ import { cspawn, Exception, ptree } from "@oh-my-pi/pi-utils"; -import { getShellConfig } from "../utils/shell"; -import { getOrCreateSnapshot, getSnapshotSourceCommand } from "../utils/shell-snapshot"; +import { getShellConfig } from "$c/utils/shell"; +import { getOrCreateSnapshot, getSnapshotSourceCommand } from "$c/utils/shell-snapshot"; import { OutputSink } from "./streaming-output"; export interface BashExecutorOptions { diff --git a/packages/coding-agent/src/core/compaction/branch-summarization.ts b/packages/coding-agent/src/core/compaction/branch-summarization.ts index fc6a8399f..794547e77 100644 --- a/packages/coding-agent/src/core/compaction/branch-summarization.ts +++ b/packages/coding-agent/src/core/compaction/branch-summarization.ts @@ -8,16 +8,16 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { Model } from "@oh-my-pi/pi-ai"; import { completeSimple } from "@oh-my-pi/pi-ai"; -import branchSummaryPrompt from "../../prompts/compaction/branch-summary.md" with { type: "text" }; -import branchSummaryPreamble from "../../prompts/compaction/branch-summary-preamble.md" with { type: "text" }; import { convertToLlm, createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage, -} from "../messages"; -import { renderPromptTemplate } from "../prompt-templates"; -import type { ReadonlySessionManager, SessionEntry } from "../session-manager"; +} from "$c/core/messages"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { ReadonlySessionManager, SessionEntry } from "$c/core/session-manager"; +import branchSummaryPrompt from "$c/prompts/compaction/branch-summary.md" with { type: "text" }; +import branchSummaryPreamble from "$c/prompts/compaction/branch-summary-preamble.md" with { type: "text" }; import { estimateTokens } from "./compaction"; import { computeFileLists, diff --git a/packages/coding-agent/src/core/compaction/compaction.ts b/packages/coding-agent/src/core/compaction/compaction.ts index 4bc374cbe..ac7767db1 100644 --- a/packages/coding-agent/src/core/compaction/compaction.ts +++ b/packages/coding-agent/src/core/compaction/compaction.ts @@ -8,12 +8,12 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { AssistantMessage, Model, Usage } from "@oh-my-pi/pi-ai"; import { completeSimple } from "@oh-my-pi/pi-ai"; -import compactionSummaryPrompt from "../../prompts/compaction/compaction-summary.md" with { type: "text" }; -import compactionTurnPrefixPrompt from "../../prompts/compaction/compaction-turn-prefix.md" with { type: "text" }; -import compactionUpdateSummaryPrompt from "../../prompts/compaction/compaction-update-summary.md" with { type: "text" }; -import { convertToLlm, createBranchSummaryMessage, createCustomMessage } from "../messages"; -import { renderPromptTemplate } from "../prompt-templates"; -import type { CompactionEntry, SessionEntry } from "../session-manager"; +import { convertToLlm, createBranchSummaryMessage, createCustomMessage } from "$c/core/messages"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { CompactionEntry, SessionEntry } from "$c/core/session-manager"; +import compactionSummaryPrompt from "$c/prompts/compaction/compaction-summary.md" with { type: "text" }; +import compactionTurnPrefixPrompt from "$c/prompts/compaction/compaction-turn-prefix.md" with { type: "text" }; +import compactionUpdateSummaryPrompt from "$c/prompts/compaction/compaction-update-summary.md" with { type: "text" }; import { computeFileLists, createFileOps, diff --git a/packages/coding-agent/src/core/compaction/utils.ts b/packages/coding-agent/src/core/compaction/utils.ts index 627b0efe7..d5912a521 100644 --- a/packages/coding-agent/src/core/compaction/utils.ts +++ b/packages/coding-agent/src/core/compaction/utils.ts @@ -4,9 +4,9 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { Message } from "@oh-my-pi/pi-ai"; -import fileOperationsTemplate from "../../prompts/system/file-operations.md" with { type: "text" }; -import summarizationSystemPrompt from "../../prompts/system/summarization-system.md" with { type: "text" }; -import { renderPromptTemplate } from "../prompt-templates"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import fileOperationsTemplate from "$c/prompts/system/file-operations.md" with { type: "text" }; +import summarizationSystemPrompt from "$c/prompts/system/summarization-system.md" with { type: "text" }; // ============================================================================ // File Operation Tracking diff --git a/packages/coding-agent/src/core/cursor/exec-bridge.ts b/packages/coding-agent/src/core/cursor/exec-bridge.ts index af1b18eca..9bee30bf8 100644 --- a/packages/coding-agent/src/core/cursor/exec-bridge.ts +++ b/packages/coding-agent/src/core/cursor/exec-bridge.ts @@ -8,7 +8,7 @@ import type { AgentToolUpdateCallback, } from "@oh-my-pi/pi-agent-core"; import type { CursorMcpCall, CursorExecHandlers as ICursorExecHandlers, ToolResultMessage } from "@oh-my-pi/pi-ai"; -import { resolveToCwd } from "../tools/path-utils"; +import { resolveToCwd } from "$c/core/tools/path-utils"; interface CursorExecBridgeOptions { cwd: string; diff --git a/packages/coding-agent/src/core/custom-commands/bundled/review/index.ts b/packages/coding-agent/src/core/custom-commands/bundled/review/index.ts index d72a009f1..bf79b7b3a 100644 --- a/packages/coding-agent/src/core/custom-commands/bundled/review/index.ts +++ b/packages/coding-agent/src/core/custom-commands/bundled/review/index.ts @@ -12,10 +12,10 @@ * multiple reviewer agents based on diff weight and locality. */ -import reviewRequestTemplate from "../../../../prompts/review-request.md" with { type: "text" }; -import type { HookCommandContext } from "../../../hooks/types"; -import { renderPromptTemplate } from "../../../prompt-templates"; -import type { CustomCommand, CustomCommandAPI } from "../../types"; +import type { CustomCommand, CustomCommandAPI } from "$c/core/custom-commands/types"; +import type { HookCommandContext } from "$c/core/hooks/types"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import reviewRequestTemplate from "$c/prompts/review-request.md" with { type: "text" }; // ───────────────────────────────────────────────────────────────────────────── // Types diff --git a/packages/coding-agent/src/core/custom-commands/loader.ts b/packages/coding-agent/src/core/custom-commands/loader.ts index 29fd60be8..d761aa2be 100644 --- a/packages/coding-agent/src/core/custom-commands/loader.ts +++ b/packages/coding-agent/src/core/custom-commands/loader.ts @@ -9,9 +9,9 @@ import { type Dirent, existsSync, readdirSync } from "node:fs"; import * as path from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import * as typebox from "@sinclair/typebox"; -import { getAgentDir, getConfigDirs } from "../../config"; -import * as piCodingAgent from "../../index"; -import { execCommand } from "../exec"; +import { getAgentDir, getConfigDirs } from "$c/config"; +import { execCommand } from "$c/core/exec"; +import * as piCodingAgent from "$c/index"; import { ReviewCommand } from "./bundled/review"; import type { CustomCommand, diff --git a/packages/coding-agent/src/core/custom-commands/types.ts b/packages/coding-agent/src/core/custom-commands/types.ts index e882933a2..72c634f5b 100644 --- a/packages/coding-agent/src/core/custom-commands/types.ts +++ b/packages/coding-agent/src/core/custom-commands/types.ts @@ -6,7 +6,7 @@ * arbitrary logic with full access to the hook context. */ -import type { ExecOptions, ExecResult, HookCommandContext } from "../hooks/types"; +import type { ExecOptions, ExecResult, HookCommandContext } from "$c/core/hooks/types"; // Re-export for custom commands to use export type { ExecOptions, ExecResult, HookCommandContext }; diff --git a/packages/coding-agent/src/core/custom-share.ts b/packages/coding-agent/src/core/custom-share.ts index db53d4e78..f0e95eff5 100644 --- a/packages/coding-agent/src/core/custom-share.ts +++ b/packages/coding-agent/src/core/custom-share.ts @@ -7,7 +7,7 @@ import { existsSync } from "node:fs"; import { join } from "node:path"; -import { getAgentDir } from "../config"; +import { getAgentDir } from "$c/config"; export interface CustomShareResult { /** URL to display/open (optional - script may handle everything itself) */ diff --git a/packages/coding-agent/src/core/custom-tools/loader.ts b/packages/coding-agent/src/core/custom-tools/loader.ts index ebe0724e7..8aeca3a2d 100644 --- a/packages/coding-agent/src/core/custom-tools/loader.ts +++ b/packages/coding-agent/src/core/custom-tools/loader.ts @@ -8,15 +8,15 @@ import * as path from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import * as typebox from "@sinclair/typebox"; -import { toolCapability } from "../../capability/tool"; -import { type CustomTool, loadCapability } from "../../discovery"; -import { expandPath } from "../../discovery/helpers"; -import * as piCodingAgent from "../../index"; -import { theme } from "../../modes/interactive/theme/theme"; -import type { ExecOptions } from "../exec"; -import { execCommand } from "../exec"; -import type { HookUIContext } from "../hooks/types"; -import { getAllPluginToolPaths } from "../plugins/loader"; +import { toolCapability } from "$c/capability/tool"; +import type { ExecOptions } from "$c/core/exec"; +import { execCommand } from "$c/core/exec"; +import type { HookUIContext } from "$c/core/hooks/types"; +import { getAllPluginToolPaths } from "$c/core/plugins/loader"; +import { type CustomTool, loadCapability } from "$c/discovery"; +import { expandPath } from "$c/discovery/helpers"; +import * as piCodingAgent from "$c/index"; +import { theme } from "$c/modes/interactive/theme/theme"; import type { CustomToolAPI, CustomToolFactory, LoadedCustomTool, ToolLoadError } from "./types"; /** diff --git a/packages/coding-agent/src/core/custom-tools/types.ts b/packages/coding-agent/src/core/custom-tools/types.ts index f16917437..303cc79b7 100644 --- a/packages/coding-agent/src/core/custom-tools/types.ts +++ b/packages/coding-agent/src/core/custom-tools/types.ts @@ -9,11 +9,11 @@ import type { AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agen import type { Model } from "@oh-my-pi/pi-ai"; import type { Component } from "@oh-my-pi/pi-tui"; import type { Static, TSchema } from "@sinclair/typebox"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import type { ExecOptions, ExecResult } from "../exec"; -import type { HookUIContext } from "../hooks/types"; -import type { ModelRegistry } from "../model-registry"; -import type { ReadonlySessionManager } from "../session-manager"; +import type { ExecOptions, ExecResult } from "$c/core/exec"; +import type { HookUIContext } from "$c/core/hooks/types"; +import type { ModelRegistry } from "$c/core/model-registry"; +import type { ReadonlySessionManager } from "$c/core/session-manager"; +import type { Theme } from "$c/modes/interactive/theme/theme"; /** Alias for clarity */ export type CustomToolUIContext = HookUIContext; @@ -22,7 +22,7 @@ export type CustomToolUIContext = HookUIContext; export type { AgentToolResult, AgentToolUpdateCallback }; // Re-export for backward compatibility -export type { ExecOptions, ExecResult } from "../exec"; +export type { ExecOptions, ExecResult } from "$c/core/exec"; /** API passed to custom tool factory (stable across session changes) */ export interface CustomToolAPI { diff --git a/packages/coding-agent/src/core/custom-tools/wrapper.ts b/packages/coding-agent/src/core/custom-tools/wrapper.ts index 7fdc68453..f121b5428 100644 --- a/packages/coding-agent/src/core/custom-tools/wrapper.ts +++ b/packages/coding-agent/src/core/custom-tools/wrapper.ts @@ -5,7 +5,7 @@ import type { AgentTool, AgentToolResult, AgentToolUpdateCallback, RenderResultOptions } from "@oh-my-pi/pi-agent-core"; import type { Component } from "@oh-my-pi/pi-tui"; import type { Static, TSchema } from "@sinclair/typebox"; -import type { Theme } from "../../modes/interactive/theme/theme"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import type { CustomTool, CustomToolContext, LoadedCustomTool } from "./types"; export class CustomToolAdapter diff --git a/packages/coding-agent/src/core/export-html/index.ts b/packages/coding-agent/src/core/export-html/index.ts index 84713308c..f43ed4e89 100644 --- a/packages/coding-agent/src/core/export-html/index.ts +++ b/packages/coding-agent/src/core/export-html/index.ts @@ -1,9 +1,9 @@ import { existsSync, writeFileSync } from "node:fs"; import { basename } from "node:path"; import type { AgentState } from "@oh-my-pi/pi-agent-core"; -import { APP_NAME } from "../../config"; -import { getResolvedThemeColors, getThemeExportColors } from "../../modes/interactive/theme/theme"; -import { SessionManager } from "../session-manager"; +import { APP_NAME } from "$c/config"; +import { SessionManager } from "$c/core/session-manager"; +import { getResolvedThemeColors, getThemeExportColors } from "$c/modes/interactive/theme/theme"; // Pre-generated template (created by scripts/generate-template.ts at publish time) import { TEMPLATE } from "./template.generated"; diff --git a/packages/coding-agent/src/core/extensions/loader.ts b/packages/coding-agent/src/core/extensions/loader.ts index a432b1528..573d4dbb8 100644 --- a/packages/coding-agent/src/core/extensions/loader.ts +++ b/packages/coding-agent/src/core/extensions/loader.ts @@ -10,14 +10,14 @@ import type { KeyId } from "@oh-my-pi/pi-tui"; import { logger } from "@oh-my-pi/pi-utils"; import type { TSchema } from "@sinclair/typebox"; import * as TypeBox from "@sinclair/typebox"; -import { type ExtensionModule, extensionModuleCapability } from "../../capability/extension-module"; -import { loadCapability } from "../../discovery"; -import { expandPath, getExtensionNameFromPath } from "../../discovery/helpers"; -import * as piCodingAgent from "../../index"; -import { EventBus } from "../event-bus"; -import type { ExecOptions } from "../exec"; -import { execCommand } from "../exec"; -import type { CustomMessage } from "../messages"; +import { type ExtensionModule, extensionModuleCapability } from "$c/capability/extension-module"; +import { EventBus } from "$c/core/event-bus"; +import type { ExecOptions } from "$c/core/exec"; +import { execCommand } from "$c/core/exec"; +import type { CustomMessage } from "$c/core/messages"; +import { loadCapability } from "$c/discovery"; +import { expandPath, getExtensionNameFromPath } from "$c/discovery/helpers"; +import * as piCodingAgent from "$c/index"; import type { Extension, ExtensionAPI, diff --git a/packages/coding-agent/src/core/extensions/runner.ts b/packages/coding-agent/src/core/extensions/runner.ts index c699a7ddf..2c955154b 100644 --- a/packages/coding-agent/src/core/extensions/runner.ts +++ b/packages/coding-agent/src/core/extensions/runner.ts @@ -6,9 +6,9 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, Model } from "@oh-my-pi/pi-ai"; import type { KeyId } from "@oh-my-pi/pi-tui"; import { logger } from "@oh-my-pi/pi-utils"; -import { type Theme, theme } from "../../modes/interactive/theme/theme"; -import type { ModelRegistry } from "../model-registry"; -import type { SessionManager } from "../session-manager"; +import type { ModelRegistry } from "$c/core/model-registry"; +import type { SessionManager } from "$c/core/session-manager"; +import { type Theme, theme } from "$c/modes/interactive/theme/theme"; import type { BeforeAgentStartEvent, BeforeAgentStartEventResult, diff --git a/packages/coding-agent/src/core/extensions/types.ts b/packages/coding-agent/src/core/extensions/types.ts index f5036898a..78508cc8b 100644 --- a/packages/coding-agent/src/core/extensions/types.ts +++ b/packages/coding-agent/src/core/extensions/types.ts @@ -12,28 +12,28 @@ import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLe import type { ImageContent, Model, TextContent, ToolResultMessage } from "@oh-my-pi/pi-ai"; import type { AutocompleteItem, Component, EditorComponent, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui"; import type { Static, TSchema } from "@sinclair/typebox"; -import type * as piCodingAgent from "../../index"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import type { BashResult } from "../bash-executor"; -import type { CompactionPreparation, CompactionResult } from "../compaction"; -import type { EventBus } from "../event-bus"; -import type { ExecOptions, ExecResult } from "../exec"; -import type { KeybindingsManager } from "../keybindings"; -import type { CustomMessage } from "../messages"; -import type { ModelRegistry } from "../model-registry"; -import type { PythonResult } from "../python-executor"; +import type { BashResult } from "$c/core/bash-executor"; +import type { CompactionPreparation, CompactionResult } from "$c/core/compaction"; +import type { EventBus } from "$c/core/event-bus"; +import type { ExecOptions, ExecResult } from "$c/core/exec"; +import type { KeybindingsManager } from "$c/core/keybindings"; +import type { CustomMessage } from "$c/core/messages"; +import type { ModelRegistry } from "$c/core/model-registry"; +import type { PythonResult } from "$c/core/python-executor"; import type { BranchSummaryEntry, CompactionEntry, ReadonlySessionManager, SessionEntry, SessionManager, -} from "../session-manager"; -import type { BashToolDetails, FindToolDetails, GrepToolDetails, LsToolDetails, ReadToolDetails } from "../tools"; -import type { EditToolDetails } from "../tools/patch"; +} from "$c/core/session-manager"; +import type { BashToolDetails, FindToolDetails, GrepToolDetails, LsToolDetails, ReadToolDetails } from "$c/core/tools"; +import type { EditToolDetails } from "$c/core/tools/patch"; +import type * as piCodingAgent from "$c/index"; +import type { Theme } from "$c/modes/interactive/theme/theme"; -export type { ExecOptions, ExecResult } from "../exec"; -export type { AppAction, KeybindingsManager } from "../keybindings"; +export type { ExecOptions, ExecResult } from "$c/core/exec"; +export type { AppAction, KeybindingsManager } from "$c/core/keybindings"; export type { AgentToolResult, AgentToolUpdateCallback }; // ============================================================================ diff --git a/packages/coding-agent/src/core/extensions/wrapper.ts b/packages/coding-agent/src/core/extensions/wrapper.ts index edc82beb6..741e3059a 100644 --- a/packages/coding-agent/src/core/extensions/wrapper.ts +++ b/packages/coding-agent/src/core/extensions/wrapper.ts @@ -5,7 +5,7 @@ import type { AgentTool, AgentToolContext, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai"; import type { Static, TSchema } from "@sinclair/typebox"; -import type { Theme } from "../../modes/interactive/theme/theme"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import type { ExtensionRunner } from "./runner"; import type { RegisteredTool, ToolCallEventResult, ToolResultEventResult } from "./types"; diff --git a/packages/coding-agent/src/core/history-storage.ts b/packages/coding-agent/src/core/history-storage.ts index f32134d33..b06f3772d 100644 --- a/packages/coding-agent/src/core/history-storage.ts +++ b/packages/coding-agent/src/core/history-storage.ts @@ -2,7 +2,7 @@ import { Database } from "bun:sqlite"; import { mkdirSync } from "node:fs"; import { dirname, join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; -import { getAgentDir } from "../config"; +import { getAgentDir } from "$c/config"; export interface HistoryEntry { id: number; diff --git a/packages/coding-agent/src/core/hooks/index.ts b/packages/coding-agent/src/core/hooks/index.ts index 8823408bd..3cba5aeac 100644 --- a/packages/coding-agent/src/core/hooks/index.ts +++ b/packages/coding-agent/src/core/hooks/index.ts @@ -1,5 +1,5 @@ // biome-ignore assist/source/organizeImports: biome is not smart -export type { ReadonlySessionManager, UsageStatistics } from "../session-manager"; +export type { ReadonlySessionManager, UsageStatistics } from "$c/core/session-manager"; export { discoverAndLoadHooks, loadHooks, diff --git a/packages/coding-agent/src/core/hooks/loader.ts b/packages/coding-agent/src/core/hooks/loader.ts index 3f3197b8f..d1cce69e0 100644 --- a/packages/coding-agent/src/core/hooks/loader.ts +++ b/packages/coding-agent/src/core/hooks/loader.ts @@ -5,13 +5,13 @@ import * as path from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import * as typebox from "@sinclair/typebox"; -import { hookCapability } from "../../capability/hook"; -import type { Hook } from "../../discovery"; -import { loadCapability } from "../../discovery"; -import { expandPath } from "../../discovery/helpers"; -import * as piCodingAgent from "../../index"; -import type { HookMessage } from "../messages"; -import type { SessionManager } from "../session-manager"; +import { hookCapability } from "$c/capability/hook"; +import type { HookMessage } from "$c/core/messages"; +import type { SessionManager } from "$c/core/session-manager"; +import type { Hook } from "$c/discovery"; +import { loadCapability } from "$c/discovery"; +import { expandPath } from "$c/discovery/helpers"; +import * as piCodingAgent from "$c/index"; import { execCommand } from "./runner"; import type { ExecOptions, HookAPI, HookFactory, HookMessageRenderer, RegisteredCommand } from "./types"; diff --git a/packages/coding-agent/src/core/hooks/runner.ts b/packages/coding-agent/src/core/hooks/runner.ts index e1081657a..b568889ad 100644 --- a/packages/coding-agent/src/core/hooks/runner.ts +++ b/packages/coding-agent/src/core/hooks/runner.ts @@ -4,9 +4,9 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { Model } from "@oh-my-pi/pi-ai"; -import { theme } from "../../modes/interactive/theme/theme"; -import type { ModelRegistry } from "../model-registry"; -import type { SessionManager } from "../session-manager"; +import type { ModelRegistry } from "$c/core/model-registry"; +import type { SessionManager } from "$c/core/session-manager"; +import { theme } from "$c/modes/interactive/theme/theme"; import type { AppendEntryHandler, BranchHandler, @@ -40,7 +40,7 @@ import type { export type HookErrorListener = (error: HookError) => void; // Re-export execCommand for backward compatibility -export { execCommand } from "../exec"; +export { execCommand } from "$c/core/exec"; /** No-op UI context used when no UI is available */ const noOpUIContext: HookUIContext = { diff --git a/packages/coding-agent/src/core/hooks/types.ts b/packages/coding-agent/src/core/hooks/types.ts index 69ceb97da..e42b6c09e 100644 --- a/packages/coding-agent/src/core/hooks/types.ts +++ b/packages/coding-agent/src/core/hooks/types.ts @@ -8,23 +8,29 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, Message, Model, TextContent, ToolResultMessage } from "@oh-my-pi/pi-ai"; import type { Component, TUI } from "@oh-my-pi/pi-tui"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import type { CompactionPreparation, CompactionResult } from "../compaction/index"; -import type { ExecOptions, ExecResult } from "../exec"; -import type { HookMessage } from "../messages"; -import type { ModelRegistry } from "../model-registry"; +import type { CompactionPreparation, CompactionResult } from "$c/core/compaction/index"; +import type { ExecOptions, ExecResult } from "$c/core/exec"; +import type { HookMessage } from "$c/core/messages"; +import type { ModelRegistry } from "$c/core/model-registry"; import type { BranchSummaryEntry, CompactionEntry, ReadonlySessionManager, SessionEntry, SessionManager, -} from "../session-manager"; -import type { BashToolDetails, FindToolDetails, GrepToolDetails, LsToolDetails, ReadToolDetails } from "../tools/index"; -import type { EditToolDetails } from "../tools/patch"; +} from "$c/core/session-manager"; +import type { + BashToolDetails, + FindToolDetails, + GrepToolDetails, + LsToolDetails, + ReadToolDetails, +} from "$c/core/tools/index"; +import type { EditToolDetails } from "$c/core/tools/patch"; +import type { Theme } from "$c/modes/interactive/theme/theme"; // Re-export for backward compatibility -export type { ExecOptions, ExecResult } from "../exec"; +export type { ExecOptions, ExecResult } from "$c/core/exec"; /** * UI context for hooks to request interactive UI from the harness. diff --git a/packages/coding-agent/src/core/internal-urls/rule-protocol.ts b/packages/coding-agent/src/core/internal-urls/rule-protocol.ts index 6aedb05cc..5101f9ed6 100644 --- a/packages/coding-agent/src/core/internal-urls/rule-protocol.ts +++ b/packages/coding-agent/src/core/internal-urls/rule-protocol.ts @@ -7,7 +7,7 @@ * - rule:// - Reads rule content */ -import type { Rule } from "../../capability/rule"; +import type { Rule } from "$c/capability/rule"; import type { InternalResource, InternalUrl, ProtocolHandler } from "./types"; export interface RuleProtocolOptions { diff --git a/packages/coding-agent/src/core/internal-urls/skill-protocol.ts b/packages/coding-agent/src/core/internal-urls/skill-protocol.ts index cbe27c802..21a4f0e5a 100644 --- a/packages/coding-agent/src/core/internal-urls/skill-protocol.ts +++ b/packages/coding-agent/src/core/internal-urls/skill-protocol.ts @@ -9,7 +9,7 @@ */ import * as path from "node:path"; -import type { Skill } from "../skills"; +import type { Skill } from "$c/core/skills"; import type { InternalResource, InternalUrl, ProtocolHandler } from "./types"; export interface SkillProtocolOptions { diff --git a/packages/coding-agent/src/core/keybindings.ts b/packages/coding-agent/src/core/keybindings.ts index 99c5de4ea..c82dc44d8 100644 --- a/packages/coding-agent/src/core/keybindings.ts +++ b/packages/coding-agent/src/core/keybindings.ts @@ -10,7 +10,7 @@ import { setEditorKeybindings, } from "@oh-my-pi/pi-tui"; import { logger } from "@oh-my-pi/pi-utils"; -import { getAgentDir } from "../config"; +import { getAgentDir } from "$c/config"; /** * Application-level actions (coding agent specific). diff --git a/packages/coding-agent/src/core/mcp/config.ts b/packages/coding-agent/src/core/mcp/config.ts index 41944f82c..b5d0b5934 100644 --- a/packages/coding-agent/src/core/mcp/config.ts +++ b/packages/coding-agent/src/core/mcp/config.ts @@ -4,9 +4,9 @@ * Uses the capability system to load MCP servers from multiple sources. */ -import { mcpCapability } from "../../capability/mcp"; -import type { MCPServer } from "../../discovery"; -import { loadCapability } from "../../discovery"; +import { mcpCapability } from "$c/capability/mcp"; +import type { MCPServer } from "$c/discovery"; +import { loadCapability } from "$c/discovery"; import type { MCPServerConfig } from "./types"; /** Options for loading MCP configs */ diff --git a/packages/coding-agent/src/core/mcp/loader.ts b/packages/coding-agent/src/core/mcp/loader.ts index 9938f00a5..63a6aaf4d 100644 --- a/packages/coding-agent/src/core/mcp/loader.ts +++ b/packages/coding-agent/src/core/mcp/loader.ts @@ -5,8 +5,8 @@ */ import { logger } from "@oh-my-pi/pi-utils"; -import { AgentStorage } from "../agent-storage"; -import type { LoadedCustomTool } from "../custom-tools/types"; +import { AgentStorage } from "$c/core/agent-storage"; +import type { LoadedCustomTool } from "$c/core/custom-tools/types"; import { type MCPLoadResult, MCPManager } from "./manager"; import { MCPToolCache } from "./tool-cache"; diff --git a/packages/coding-agent/src/core/mcp/manager.ts b/packages/coding-agent/src/core/mcp/manager.ts index 29e9bdc53..7f668058f 100644 --- a/packages/coding-agent/src/core/mcp/manager.ts +++ b/packages/coding-agent/src/core/mcp/manager.ts @@ -7,7 +7,7 @@ import { logger } from "@oh-my-pi/pi-utils"; import type { TSchema } from "@sinclair/typebox"; -import type { CustomTool } from "../custom-tools/types"; +import type { CustomTool } from "$c/core/custom-tools/types"; import { connectToServer, disconnectServer, listTools } from "./client"; import { loadAllMCPConfigs, validateServerConfig } from "./config"; import type { MCPToolDetails } from "./tool-bridge"; diff --git a/packages/coding-agent/src/core/mcp/tool-bridge.ts b/packages/coding-agent/src/core/mcp/tool-bridge.ts index 72936af75..1a6d8f724 100644 --- a/packages/coding-agent/src/core/mcp/tool-bridge.ts +++ b/packages/coding-agent/src/core/mcp/tool-bridge.ts @@ -6,8 +6,8 @@ import type { AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import type { TSchema } from "@sinclair/typebox"; -import type { SourceMeta } from "../../capability/types"; -import type { CustomTool, CustomToolContext, CustomToolResult } from "../custom-tools/types"; +import type { SourceMeta } from "$c/capability/types"; +import type { CustomTool, CustomToolContext, CustomToolResult } from "$c/core/custom-tools/types"; import { callTool } from "./client"; import type { MCPContent, MCPServerConnection, MCPToolDefinition } from "./types"; diff --git a/packages/coding-agent/src/core/mcp/tool-cache.ts b/packages/coding-agent/src/core/mcp/tool-cache.ts index 64e619f19..eb2228720 100644 --- a/packages/coding-agent/src/core/mcp/tool-cache.ts +++ b/packages/coding-agent/src/core/mcp/tool-cache.ts @@ -5,7 +5,7 @@ */ import { logger } from "@oh-my-pi/pi-utils"; -import type { AgentStorage } from "../agent-storage"; +import type { AgentStorage } from "$c/core/agent-storage"; import type { MCPServerConfig, MCPToolDefinition } from "./types"; const CACHE_VERSION = 1; diff --git a/packages/coding-agent/src/core/mcp/transports/http.ts b/packages/coding-agent/src/core/mcp/transports/http.ts index a6d37d684..92daf93cd 100644 --- a/packages/coding-agent/src/core/mcp/transports/http.ts +++ b/packages/coding-agent/src/core/mcp/transports/http.ts @@ -5,7 +5,13 @@ * Based on MCP spec 2025-03-26. */ -import type { JsonRpcMessage, JsonRpcResponse, MCPHttpServerConfig, MCPSseServerConfig, MCPTransport } from "../types"; +import type { + JsonRpcMessage, + JsonRpcResponse, + MCPHttpServerConfig, + MCPSseServerConfig, + MCPTransport, +} from "$c/core/mcp/types"; /** Generate unique request ID */ function generateId(): string { diff --git a/packages/coding-agent/src/core/mcp/transports/stdio.ts b/packages/coding-agent/src/core/mcp/transports/stdio.ts index 7ddd448b1..560700cee 100644 --- a/packages/coding-agent/src/core/mcp/transports/stdio.ts +++ b/packages/coding-agent/src/core/mcp/transports/stdio.ts @@ -6,7 +6,7 @@ */ import { type Subprocess, spawn } from "bun"; -import type { JsonRpcResponse, MCPStdioServerConfig, MCPTransport } from "../types"; +import type { JsonRpcResponse, MCPStdioServerConfig, MCPTransport } from "$c/core/mcp/types"; /** Generate unique request ID */ function generateId(): string { diff --git a/packages/coding-agent/src/core/model-resolver.ts b/packages/coding-agent/src/core/model-resolver.ts index e12fbd2a4..b526c63ec 100644 --- a/packages/coding-agent/src/core/model-resolver.ts +++ b/packages/coding-agent/src/core/model-resolver.ts @@ -5,7 +5,7 @@ import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import { type Api, type KnownProvider, type Model, modelsAreEqual } from "@oh-my-pi/pi-ai"; import chalk from "chalk"; -import { isValidThinkingLevel } from "../cli/args"; +import { isValidThinkingLevel } from "$c/cli/args"; import type { ModelRegistry } from "./model-registry"; /** Default model IDs for each known provider */ diff --git a/packages/coding-agent/src/core/plugins/doctor.ts b/packages/coding-agent/src/core/plugins/doctor.ts index 235d8f0eb..b89672f96 100644 --- a/packages/coding-agent/src/core/plugins/doctor.ts +++ b/packages/coding-agent/src/core/plugins/doctor.ts @@ -1,4 +1,4 @@ -import { theme } from "../../modes/interactive/theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; import type { DoctorCheck } from "./types"; export async function runDoctorChecks(): Promise { diff --git a/packages/coding-agent/src/core/plugins/installer.ts b/packages/coding-agent/src/core/plugins/installer.ts index 13e85f462..f4e57d132 100644 --- a/packages/coding-agent/src/core/plugins/installer.ts +++ b/packages/coding-agent/src/core/plugins/installer.ts @@ -1,7 +1,7 @@ import { lstatSync, symlinkSync, unlinkSync } from "node:fs"; import { mkdir } from "node:fs/promises"; import { join, resolve } from "node:path"; -import { getAgentDir } from "../../config"; +import { getAgentDir } from "$c/config"; import type { InstalledPlugin } from "./types"; const PLUGINS_DIR = join(getAgentDir(), "plugins"); diff --git a/packages/coding-agent/src/core/plugins/paths.ts b/packages/coding-agent/src/core/plugins/paths.ts index 7af1d984c..1fa638b0e 100644 --- a/packages/coding-agent/src/core/plugins/paths.ts +++ b/packages/coding-agent/src/core/plugins/paths.ts @@ -1,6 +1,6 @@ import { homedir } from "node:os"; import { join } from "node:path"; -import { CONFIG_DIR_NAME, getConfigDirPaths } from "../../config"; +import { CONFIG_DIR_NAME, getConfigDirPaths } from "$c/config"; // ============================================================================= // Plugin Directory Paths diff --git a/packages/coding-agent/src/core/prompt-templates.ts b/packages/coding-agent/src/core/prompt-templates.ts index 22c7230ab..2073f7acf 100644 --- a/packages/coding-agent/src/core/prompt-templates.ts +++ b/packages/coding-agent/src/core/prompt-templates.ts @@ -1,7 +1,7 @@ import { join, resolve } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import Handlebars from "handlebars"; -import { CONFIG_DIR_NAME, getPromptsDir } from "../config"; +import { CONFIG_DIR_NAME, getPromptsDir } from "$c/config"; import { parseFrontmatter } from "./frontmatter"; /** diff --git a/packages/coding-agent/src/core/python-gateway-coordinator.ts b/packages/coding-agent/src/core/python-gateway-coordinator.ts index 86139637d..7800c33ac 100644 --- a/packages/coding-agent/src/core/python-gateway-coordinator.ts +++ b/packages/coding-agent/src/core/python-gateway-coordinator.ts @@ -14,9 +14,9 @@ import { createServer } from "node:net"; import { delimiter, join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import type { Subprocess } from "bun"; -import { getAgentDir } from "../config"; -import { getShellConfig, killProcessTree } from "../utils/shell"; -import { getOrCreateSnapshot } from "../utils/shell-snapshot"; +import { getAgentDir } from "$c/config"; +import { getShellConfig, killProcessTree } from "$c/utils/shell"; +import { getOrCreateSnapshot } from "$c/utils/shell-snapshot"; const GATEWAY_DIR_NAME = "python-gateway"; const GATEWAY_INFO_FILE = "gateway.json"; diff --git a/packages/coding-agent/src/core/python-kernel.ts b/packages/coding-agent/src/core/python-kernel.ts index ed6244796..35a02aa29 100644 --- a/packages/coding-agent/src/core/python-kernel.ts +++ b/packages/coding-agent/src/core/python-kernel.ts @@ -3,8 +3,8 @@ import { delimiter, join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import { $, type Subprocess } from "bun"; import { nanoid } from "nanoid"; -import { getShellConfig, killProcessTree } from "../utils/shell"; -import { getOrCreateSnapshot } from "../utils/shell-snapshot"; +import { getShellConfig, killProcessTree } from "$c/utils/shell"; +import { getOrCreateSnapshot } from "$c/utils/shell-snapshot"; import { acquireSharedGateway, releaseSharedGateway } from "./python-gateway-coordinator"; import { loadPythonModules } from "./python-modules"; import { PYTHON_PRELUDE } from "./python-prelude"; diff --git a/packages/coding-agent/src/core/sdk.ts b/packages/coding-agent/src/core/sdk.ts index bbb93bedd..f268e8427 100644 --- a/packages/coding-agent/src/core/sdk.ts +++ b/packages/coding-agent/src/core/sdk.ts @@ -33,11 +33,11 @@ import type { Component } from "@oh-my-pi/pi-tui"; // Import discovery to register all providers on startup import { logger, postmortem } from "@oh-my-pi/pi-utils"; import chalk from "chalk"; -import { loadCapability } from "../capability/index"; -import { type Rule, ruleCapability } from "../capability/rule"; -import { getAgentDir, getConfigDirPaths } from "../config"; +import { loadCapability } from "$c/capability/index"; +import { type Rule, ruleCapability } from "$c/capability/rule"; +import { getAgentDir, getConfigDirPaths } from "$c/config"; import "../discovery"; -import { initializeWithSettings } from "../discovery"; +import { initializeWithSettings } from "$c/discovery"; import { AgentSession } from "./agent-session"; import { AuthStorage } from "./auth-storage"; import { CursorExecHandlers } from "./cursor/exec-bridge"; diff --git a/packages/coding-agent/src/core/session-manager.ts b/packages/coding-agent/src/core/session-manager.ts index 0a4f18ba4..c2bcff827 100644 --- a/packages/coding-agent/src/core/session-manager.ts +++ b/packages/coding-agent/src/core/session-manager.ts @@ -3,8 +3,8 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, Message, TextContent, Usage } from "@oh-my-pi/pi-ai"; import { logger } from "@oh-my-pi/pi-utils"; import { nanoid } from "nanoid"; -import { getAgentDir as getDefaultAgentDir } from "../config"; -import { resizeImage } from "../utils/image-resize"; +import { getAgentDir as getDefaultAgentDir } from "$c/config"; +import { resizeImage } from "$c/utils/image-resize"; import { type BashExecutionMessage, type CustomMessage, diff --git a/packages/coding-agent/src/core/settings-manager.ts b/packages/coding-agent/src/core/settings-manager.ts index adc708c93..fd825c550 100644 --- a/packages/coding-agent/src/core/settings-manager.ts +++ b/packages/coding-agent/src/core/settings-manager.ts @@ -1,10 +1,10 @@ import { rename } from "node:fs/promises"; import { join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; -import { type Settings as SettingsItem, settingsCapability } from "../capability/settings"; -import { getAgentDbPath, getAgentDir } from "../config"; -import { loadCapability } from "../discovery"; -import type { SymbolPreset } from "../modes/interactive/theme/theme"; +import { type Settings as SettingsItem, settingsCapability } from "$c/capability/settings"; +import { getAgentDbPath, getAgentDir } from "$c/config"; +import { loadCapability } from "$c/discovery"; +import type { SymbolPreset } from "$c/modes/interactive/theme/theme"; import { AgentStorage } from "./agent-storage"; export interface CompactionSettings { diff --git a/packages/coding-agent/src/core/skills.ts b/packages/coding-agent/src/core/skills.ts index 9c4898ebd..e68366631 100644 --- a/packages/coding-agent/src/core/skills.ts +++ b/packages/coding-agent/src/core/skills.ts @@ -2,10 +2,10 @@ import { readdirSync, readFileSync, statSync } from "node:fs"; import { realpath } from "node:fs/promises"; import { basename, join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; -import { skillCapability } from "../capability/skill"; -import type { SourceMeta } from "../capability/types"; -import type { Skill as CapabilitySkill, SkillFrontmatter as ImportedSkillFrontmatter } from "../discovery"; -import { loadCapability } from "../discovery"; +import { skillCapability } from "$c/capability/skill"; +import type { SourceMeta } from "$c/capability/types"; +import type { Skill as CapabilitySkill, SkillFrontmatter as ImportedSkillFrontmatter } from "$c/discovery"; +import { loadCapability } from "$c/discovery"; import { parseFrontmatter } from "./frontmatter"; import type { SkillsSettings } from "./settings-manager"; diff --git a/packages/coding-agent/src/core/slash-commands.ts b/packages/coding-agent/src/core/slash-commands.ts index 341e765ed..3b6ef5132 100644 --- a/packages/coding-agent/src/core/slash-commands.ts +++ b/packages/coding-agent/src/core/slash-commands.ts @@ -1,6 +1,6 @@ -import { slashCommandCapability } from "../capability/slash-command"; -import type { SlashCommand } from "../discovery"; -import { loadCapability } from "../discovery"; +import { slashCommandCapability } from "$c/capability/slash-command"; +import type { SlashCommand } from "$c/discovery"; +import { loadCapability } from "$c/discovery"; import { parseFrontmatter } from "./frontmatter"; import { renderPromptTemplate } from "./prompt-templates"; import { EMBEDDED_COMMAND_TEMPLATES } from "./tools/task/commands"; diff --git a/packages/coding-agent/src/core/ssh/connection-manager.ts b/packages/coding-agent/src/core/ssh/connection-manager.ts index 207c97400..069899612 100644 --- a/packages/coding-agent/src/core/ssh/connection-manager.ts +++ b/packages/coding-agent/src/core/ssh/connection-manager.ts @@ -3,7 +3,7 @@ import { homedir } from "node:os"; import { join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import { $ } from "bun"; -import { CONFIG_DIR_NAME } from "../../config"; +import { CONFIG_DIR_NAME } from "$c/config"; export interface SSHConnectionTarget { name: string; diff --git a/packages/coding-agent/src/core/ssh/ssh-executor.ts b/packages/coding-agent/src/core/ssh/ssh-executor.ts index eda126fb2..ce0c31f02 100644 --- a/packages/coding-agent/src/core/ssh/ssh-executor.ts +++ b/packages/coding-agent/src/core/ssh/ssh-executor.ts @@ -1,5 +1,5 @@ import { cspawn, logger, ptree } from "@oh-my-pi/pi-utils"; -import { OutputSink } from "../streaming-output"; +import { OutputSink } from "$c/core/streaming-output"; import { buildRemoteCommand, ensureConnection, ensureHostInfo, type SSHConnectionTarget } from "./connection-manager"; import { hasSshfs, mountRemote } from "./sshfs-mount"; diff --git a/packages/coding-agent/src/core/ssh/sshfs-mount.ts b/packages/coding-agent/src/core/ssh/sshfs-mount.ts index 324e1ac5f..15f2f1e00 100644 --- a/packages/coding-agent/src/core/ssh/sshfs-mount.ts +++ b/packages/coding-agent/src/core/ssh/sshfs-mount.ts @@ -3,7 +3,7 @@ import { homedir } from "node:os"; import { join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import { $ } from "bun"; -import { CONFIG_DIR_NAME } from "../../config"; +import { CONFIG_DIR_NAME } from "$c/config"; import { getControlDir, getControlPathTemplate, type SSHConnectionTarget } from "./connection-manager"; const REMOTE_DIR = join(homedir(), CONFIG_DIR_NAME, "remote"); diff --git a/packages/coding-agent/src/core/storage-migration.ts b/packages/coding-agent/src/core/storage-migration.ts index c80eaaa1a..4b4a3ced3 100644 --- a/packages/coding-agent/src/core/storage-migration.ts +++ b/packages/coding-agent/src/core/storage-migration.ts @@ -5,7 +5,7 @@ */ import { logger } from "@oh-my-pi/pi-utils"; -import { getAgentDbPath } from "../config"; +import { getAgentDbPath } from "$c/config"; import { AgentStorage } from "./agent-storage"; import type { AuthCredential, AuthCredentialEntry, AuthStorageData } from "./auth-storage"; import type { Settings } from "./settings-manager"; diff --git a/packages/coding-agent/src/core/system-prompt.ts b/packages/coding-agent/src/core/system-prompt.ts index 34cc9f7eb..69eec8843 100644 --- a/packages/coding-agent/src/core/system-prompt.ts +++ b/packages/coding-agent/src/core/system-prompt.ts @@ -7,11 +7,11 @@ import { homedir } from "node:os"; import { join } from "node:path"; import { $ } from "bun"; import chalk from "chalk"; -import { contextFileCapability } from "../capability/context-file"; -import { systemPromptCapability } from "../capability/system-prompt"; -import { type ContextFile, loadCapability, type SystemPrompt as SystemPromptFile } from "../discovery/index"; -import customSystemPromptTemplate from "../prompts/system/custom-system-prompt.md" with { type: "text" }; -import systemPromptTemplate from "../prompts/system/system-prompt.md" with { type: "text" }; +import { contextFileCapability } from "$c/capability/context-file"; +import { systemPromptCapability } from "$c/capability/system-prompt"; +import { type ContextFile, loadCapability, type SystemPrompt as SystemPromptFile } from "$c/discovery/index"; +import customSystemPromptTemplate from "$c/prompts/system/custom-system-prompt.md" with { type: "text" }; +import systemPromptTemplate from "$c/prompts/system/system-prompt.md" with { type: "text" }; import { renderPromptTemplate } from "./prompt-templates"; import type { SkillsSettings } from "./settings-manager"; import { loadSkills, type Skill } from "./skills"; diff --git a/packages/coding-agent/src/core/title-generator.ts b/packages/coding-agent/src/core/title-generator.ts index 7046a4c08..f422919ba 100644 --- a/packages/coding-agent/src/core/title-generator.ts +++ b/packages/coding-agent/src/core/title-generator.ts @@ -5,7 +5,7 @@ import type { Api, Model } from "@oh-my-pi/pi-ai"; import { completeSimple } from "@oh-my-pi/pi-ai"; import { logger } from "@oh-my-pi/pi-utils"; -import titleSystemPrompt from "../prompts/system/title-system.md" with { type: "text" }; +import titleSystemPrompt from "$c/prompts/system/title-system.md" with { type: "text" }; import type { ModelRegistry } from "./model-registry"; import { parseModelString, SMOL_MODEL_PRIORITY } from "./model-resolver"; import { renderPromptTemplate } from "./prompt-templates"; diff --git a/packages/coding-agent/src/core/tools/ask.ts b/packages/coding-agent/src/core/tools/ask.ts index 1ed8ca459..7a81846dd 100644 --- a/packages/coding-agent/src/core/tools/ask.ts +++ b/packages/coding-agent/src/core/tools/ask.ts @@ -19,10 +19,10 @@ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallb import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; import { Type } from "@sinclair/typebox"; -import { type Theme, theme } from "../../modes/interactive/theme/theme"; -import askDescription from "../../prompts/tools/ask.md" with { type: "text" }; -import type { RenderResultOptions } from "../custom-tools/types"; -import { renderPromptTemplate } from "../prompt-templates"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { type Theme, theme } from "$c/modes/interactive/theme/theme"; +import askDescription from "$c/prompts/tools/ask.md" with { type: "text" }; import type { ToolSession } from "./index"; import { ToolUIKit } from "./render-utils"; diff --git a/packages/coding-agent/src/core/tools/bash-interceptor.ts b/packages/coding-agent/src/core/tools/bash-interceptor.ts index 1feea66df..27ddcafdb 100644 --- a/packages/coding-agent/src/core/tools/bash-interceptor.ts +++ b/packages/coding-agent/src/core/tools/bash-interceptor.ts @@ -6,7 +6,7 @@ * the specialized tools instead. */ -import { type BashInterceptorRule, DEFAULT_BASH_INTERCEPTOR_RULES } from "../settings-manager"; +import { type BashInterceptorRule, DEFAULT_BASH_INTERCEPTOR_RULES } from "$c/core/settings-manager"; export interface InterceptionResult { /** If true, the bash command should be blocked */ diff --git a/packages/coding-agent/src/core/tools/bash.ts b/packages/coding-agent/src/core/tools/bash.ts index dc1758774..a47da5974 100644 --- a/packages/coding-agent/src/core/tools/bash.ts +++ b/packages/coding-agent/src/core/tools/bash.ts @@ -3,14 +3,14 @@ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallb import type { Component } from "@oh-my-pi/pi-tui"; import { Text, truncateToWidth } from "@oh-my-pi/pi-tui"; import { Type } from "@sinclair/typebox"; -import { truncateToVisualLines } from "../../modes/interactive/components/visual-truncate"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import bashDescription from "../../prompts/tools/bash.md" with { type: "text" }; -import { type BashExecutorOptions, executeBash } from "../bash-executor"; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import { ToolError } from "../tool-errors"; +import { type BashExecutorOptions, executeBash } from "$c/core/bash-executor"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { ToolError } from "$c/core/tool-errors"; +import { truncateToVisualLines } from "$c/modes/interactive/components/visual-truncate"; +import type { Theme } from "$c/modes/interactive/theme/theme"; +import bashDescription from "$c/prompts/tools/bash.md" with { type: "text" }; import { checkBashInterception, checkSimpleLsInterception } from "./bash-interceptor"; import type { ToolSession } from "./index"; diff --git a/packages/coding-agent/src/core/tools/calculator.ts b/packages/coding-agent/src/core/tools/calculator.ts index 571731063..935ebad43 100644 --- a/packages/coding-agent/src/core/tools/calculator.ts +++ b/packages/coding-agent/src/core/tools/calculator.ts @@ -3,10 +3,10 @@ import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; import { untilAborted } from "@oh-my-pi/pi-utils"; import { Type } from "@sinclair/typebox"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import calculatorDescription from "../../prompts/tools/calculator.md" with { type: "text" }; -import type { RenderResultOptions } from "../custom-tools/types"; -import { renderPromptTemplate } from "../prompt-templates"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { Theme } from "$c/modes/interactive/theme/theme"; +import calculatorDescription from "$c/prompts/tools/calculator.md" with { type: "text" }; import type { ToolSession } from "./index"; import { formatCount, diff --git a/packages/coding-agent/src/core/tools/context.ts b/packages/coding-agent/src/core/tools/context.ts index 63a2656f6..932f783f9 100644 --- a/packages/coding-agent/src/core/tools/context.ts +++ b/packages/coding-agent/src/core/tools/context.ts @@ -1,6 +1,6 @@ import type { AgentToolContext, ToolCallContext } from "@oh-my-pi/pi-agent-core"; -import type { CustomToolContext } from "../custom-tools/types"; -import type { ExtensionUIContext } from "../extensions/types"; +import type { CustomToolContext } from "$c/core/custom-tools/types"; +import type { ExtensionUIContext } from "$c/core/extensions/types"; declare module "@oh-my-pi/pi-agent-core" { interface AgentToolContext extends CustomToolContext { diff --git a/packages/coding-agent/src/core/tools/exa/company.ts b/packages/coding-agent/src/core/tools/exa/company.ts index 6a0a47242..e9764666f 100644 --- a/packages/coding-agent/src/core/tools/exa/company.ts +++ b/packages/coding-agent/src/core/tools/exa/company.ts @@ -5,7 +5,7 @@ */ import { Type } from "@sinclair/typebox"; -import type { CustomTool } from "../../custom-tools/types"; +import type { CustomTool } from "$c/core/custom-tools/types"; import { callExaTool, findApiKey, formatSearchResults, isSearchResponse } from "./mcp-client"; import type { ExaRenderDetails } from "./types"; diff --git a/packages/coding-agent/src/core/tools/exa/index.ts b/packages/coding-agent/src/core/tools/exa/index.ts index 238f143e2..bfbb16ede 100644 --- a/packages/coding-agent/src/core/tools/exa/index.ts +++ b/packages/coding-agent/src/core/tools/exa/index.ts @@ -9,8 +9,8 @@ * - 14 websets tools (CRUD, items, search, enrichment, monitor) */ -import type { CustomTool } from "../../custom-tools/types"; -import type { ExaSettings } from "../../settings-manager"; +import type { CustomTool } from "$c/core/custom-tools/types"; +import type { ExaSettings } from "$c/core/settings-manager"; import { companyTool } from "./company"; import { linkedinTool } from "./linkedin"; import { researcherTools } from "./researcher"; diff --git a/packages/coding-agent/src/core/tools/exa/linkedin.ts b/packages/coding-agent/src/core/tools/exa/linkedin.ts index 42f57d3dc..4e1ee2b5b 100644 --- a/packages/coding-agent/src/core/tools/exa/linkedin.ts +++ b/packages/coding-agent/src/core/tools/exa/linkedin.ts @@ -5,7 +5,7 @@ */ import { Type } from "@sinclair/typebox"; -import type { CustomTool } from "../../custom-tools/types"; +import type { CustomTool } from "$c/core/custom-tools/types"; import { callExaTool, findApiKey, formatSearchResults, isSearchResponse } from "./mcp-client"; import type { ExaRenderDetails } from "./types"; diff --git a/packages/coding-agent/src/core/tools/exa/mcp-client.ts b/packages/coding-agent/src/core/tools/exa/mcp-client.ts index 20b323af0..a22e8a512 100644 --- a/packages/coding-agent/src/core/tools/exa/mcp-client.ts +++ b/packages/coding-agent/src/core/tools/exa/mcp-client.ts @@ -8,8 +8,8 @@ import { existsSync, readFileSync } from "node:fs"; import { homedir } from "node:os"; import { logger } from "@oh-my-pi/pi-utils"; import type { TSchema } from "@sinclair/typebox"; -import type { CustomTool, CustomToolResult } from "../../custom-tools/types"; -import { callMCP } from "../../mcp/json-rpc"; +import type { CustomTool, CustomToolResult } from "$c/core/custom-tools/types"; +import { callMCP } from "$c/core/mcp/json-rpc"; import type { ExaRenderDetails, ExaSearchResponse, diff --git a/packages/coding-agent/src/core/tools/exa/render.ts b/packages/coding-agent/src/core/tools/exa/render.ts index 0433051be..e23b6a879 100644 --- a/packages/coding-agent/src/core/tools/exa/render.ts +++ b/packages/coding-agent/src/core/tools/exa/render.ts @@ -7,8 +7,7 @@ import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; import { logger } from "@oh-my-pi/pi-utils"; -import type { Theme } from "../../../modes/interactive/theme/theme"; -import type { RenderResultOptions } from "../../custom-tools/types"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; import { formatCount, formatExpandHint, @@ -19,7 +18,8 @@ import { PREVIEW_LIMITS, TRUNCATE_LENGTHS, truncate, -} from "../render-utils"; +} from "$c/core/tools/render-utils"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import type { ExaRenderDetails } from "./types"; const COLLAPSED_PREVIEW_LINES = PREVIEW_LIMITS.COLLAPSED_LINES; diff --git a/packages/coding-agent/src/core/tools/exa/researcher.ts b/packages/coding-agent/src/core/tools/exa/researcher.ts index 9d95bdd79..a07995d2c 100644 --- a/packages/coding-agent/src/core/tools/exa/researcher.ts +++ b/packages/coding-agent/src/core/tools/exa/researcher.ts @@ -5,7 +5,7 @@ */ import { Type } from "@sinclair/typebox"; -import type { CustomTool } from "../../custom-tools/types"; +import type { CustomTool } from "$c/core/custom-tools/types"; import { callExaTool, findApiKey } from "./mcp-client"; import type { ExaRenderDetails } from "./types"; diff --git a/packages/coding-agent/src/core/tools/exa/search.ts b/packages/coding-agent/src/core/tools/exa/search.ts index b7ec37579..0f3b4fc72 100644 --- a/packages/coding-agent/src/core/tools/exa/search.ts +++ b/packages/coding-agent/src/core/tools/exa/search.ts @@ -6,7 +6,7 @@ import { StringEnum } from "@oh-my-pi/pi-ai"; import { Type } from "@sinclair/typebox"; -import type { CustomTool } from "../../custom-tools/types"; +import type { CustomTool } from "$c/core/custom-tools/types"; import { callExaTool, findApiKey, formatSearchResults, isSearchResponse } from "./mcp-client"; import type { ExaRenderDetails } from "./types"; diff --git a/packages/coding-agent/src/core/tools/exa/websets.ts b/packages/coding-agent/src/core/tools/exa/websets.ts index cf9e7afe2..bab27dd8c 100644 --- a/packages/coding-agent/src/core/tools/exa/websets.ts +++ b/packages/coding-agent/src/core/tools/exa/websets.ts @@ -5,7 +5,7 @@ */ import { Type } from "@sinclair/typebox"; -import type { CustomTool } from "../../custom-tools/types"; +import type { CustomTool } from "$c/core/custom-tools/types"; import { callWebsetsTool, findApiKey } from "./mcp-client"; import type { ExaRenderDetails } from "./types"; diff --git a/packages/coding-agent/src/core/tools/fetch.ts b/packages/coding-agent/src/core/tools/fetch.ts index 772373bbd..27ccc35f3 100644 --- a/packages/coding-agent/src/core/tools/fetch.ts +++ b/packages/coding-agent/src/core/tools/fetch.ts @@ -7,13 +7,13 @@ import { ptree } from "@oh-my-pi/pi-utils"; import { type Static, Type } from "@sinclair/typebox"; import { nanoid } from "nanoid"; import { parse as parseHtml } from "node-html-parser"; -import { type Theme, theme } from "../../modes/interactive/theme/theme"; -import fetchDescription from "../../prompts/tools/fetch.md" with { type: "text" }; -import { ensureTool } from "../../utils/tools-manager"; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import { ToolAbortError } from "../tool-errors"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { ToolAbortError } from "$c/core/tool-errors"; +import { type Theme, theme } from "$c/modes/interactive/theme/theme"; +import fetchDescription from "$c/prompts/tools/fetch.md" with { type: "text" }; +import { ensureTool } from "$c/utils/tools-manager"; import type { ToolSession } from "./index"; import { applyListLimit } from "./list-limit"; import { formatExpandHint } from "./render-utils"; diff --git a/packages/coding-agent/src/core/tools/find.ts b/packages/coding-agent/src/core/tools/find.ts index e5a202e27..7306dc6ad 100644 --- a/packages/coding-agent/src/core/tools/find.ts +++ b/packages/coding-agent/src/core/tools/find.ts @@ -6,13 +6,13 @@ import { Text } from "@oh-my-pi/pi-tui"; import { ptree, untilAborted } from "@oh-my-pi/pi-utils"; import type { Static } from "@sinclair/typebox"; import { Type } from "@sinclair/typebox"; -import { getLanguageFromPath, type Theme } from "../../modes/interactive/theme/theme"; -import findDescription from "../../prompts/tools/find.md" with { type: "text" }; -import { ensureTool } from "../../utils/tools-manager"; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import { ToolAbortError, ToolError, throwIfAborted } from "../tool-errors"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { ToolAbortError, ToolError, throwIfAborted } from "$c/core/tool-errors"; +import { getLanguageFromPath, type Theme } from "$c/modes/interactive/theme/theme"; +import findDescription from "$c/prompts/tools/find.md" with { type: "text" }; +import { ensureTool } from "$c/utils/tools-manager"; import type { ToolSession } from "./index"; import { applyListLimit } from "./list-limit"; diff --git a/packages/coding-agent/src/core/tools/gemini-image.ts b/packages/coding-agent/src/core/tools/gemini-image.ts index 7170e4288..6c3f738a3 100644 --- a/packages/coding-agent/src/core/tools/gemini-image.ts +++ b/packages/coding-agent/src/core/tools/gemini-image.ts @@ -4,10 +4,10 @@ import { StringEnum } from "@oh-my-pi/pi-ai"; import { untilAborted } from "@oh-my-pi/pi-utils"; import { type Static, Type } from "@sinclair/typebox"; import { nanoid } from "nanoid"; -import geminiImageDescription from "../../prompts/tools/gemini-image.md" with { type: "text" }; -import { detectSupportedImageMimeTypeFromFile } from "../../utils/mime"; -import type { CustomTool } from "../custom-tools/types"; -import { renderPromptTemplate } from "../prompt-templates"; +import type { CustomTool } from "$c/core/custom-tools/types"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import geminiImageDescription from "$c/prompts/tools/gemini-image.md" with { type: "text" }; +import { detectSupportedImageMimeTypeFromFile } from "$c/utils/mime"; import { resolveReadPath } from "./path-utils"; import { getEnv } from "./web-search/auth"; diff --git a/packages/coding-agent/src/core/tools/grep.ts b/packages/coding-agent/src/core/tools/grep.ts index 3c1850a73..88c6c07aa 100644 --- a/packages/coding-agent/src/core/tools/grep.ts +++ b/packages/coding-agent/src/core/tools/grep.ts @@ -6,14 +6,14 @@ import { Text } from "@oh-my-pi/pi-tui"; import { ptree, readLines } from "@oh-my-pi/pi-utils"; import { Type } from "@sinclair/typebox"; import { $ } from "bun"; -import { getLanguageFromPath, type Theme } from "../../modes/interactive/theme/theme"; -import grepDescription from "../../prompts/tools/grep.md" with { type: "text" }; -import { ensureTool } from "../../utils/tools-manager"; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import { ToolAbortError, ToolError } from "../tool-errors"; -import { untilAborted } from "../utils"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { ToolAbortError, ToolError } from "$c/core/tool-errors"; +import { untilAborted } from "$c/core/utils"; +import { getLanguageFromPath, type Theme } from "$c/modes/interactive/theme/theme"; +import grepDescription from "$c/prompts/tools/grep.md" with { type: "text" }; +import { ensureTool } from "$c/utils/tools-manager"; import type { ToolSession } from "./index"; import { applyListLimit } from "./list-limit"; import { resolveToCwd } from "./path-utils"; diff --git a/packages/coding-agent/src/core/tools/index.ts b/packages/coding-agent/src/core/tools/index.ts index 181e6f53a..0f62425ca 100644 --- a/packages/coding-agent/src/core/tools/index.ts +++ b/packages/coding-agent/src/core/tools/index.ts @@ -61,12 +61,12 @@ export { WriteTool, type WriteToolDetails } from "./write"; import type { AgentTool } from "@oh-my-pi/pi-agent-core"; import { logger } from "@oh-my-pi/pi-utils"; -import type { ArtifactManager } from "../artifacts"; -import type { EventBus } from "../event-bus"; -import type { InternalUrlRouter } from "../internal-urls"; -import { getPreludeDocs, warmPythonEnvironment } from "../python-executor"; -import { checkPythonKernelAvailability } from "../python-kernel"; -import type { BashInterceptorRule } from "../settings-manager"; +import type { ArtifactManager } from "$c/core/artifacts"; +import type { EventBus } from "$c/core/event-bus"; +import type { InternalUrlRouter } from "$c/core/internal-urls"; +import { getPreludeDocs, warmPythonEnvironment } from "$c/core/python-executor"; +import { checkPythonKernelAvailability } from "$c/core/python-kernel"; +import type { BashInterceptorRule } from "$c/core/settings-manager"; import { AskTool } from "./ask"; import { BashTool } from "./bash"; import { CalculatorTool } from "./calculator"; diff --git a/packages/coding-agent/src/core/tools/list-limit.ts b/packages/coding-agent/src/core/tools/list-limit.ts index 56875228b..52c0920ea 100644 --- a/packages/coding-agent/src/core/tools/list-limit.ts +++ b/packages/coding-agent/src/core/tools/list-limit.ts @@ -1,4 +1,4 @@ -import type { LimitsMeta } from "../output-meta"; +import type { LimitsMeta } from "$c/core/output-meta"; export interface ListLimitResult { items: T[]; diff --git a/packages/coding-agent/src/core/tools/ls.ts b/packages/coding-agent/src/core/tools/ls.ts index 2f06b60e2..eef92e709 100644 --- a/packages/coding-agent/src/core/tools/ls.ts +++ b/packages/coding-agent/src/core/tools/ls.ts @@ -3,10 +3,10 @@ import type { AgentTool, AgentToolResult } from "@oh-my-pi/pi-agent-core"; import { type Component, Text } from "@oh-my-pi/pi-tui"; import { untilAborted } from "@oh-my-pi/pi-utils"; import { Type } from "@sinclair/typebox"; -import { getLanguageFromPath, type Theme } from "../../modes/interactive/theme/theme"; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { ToolError, throwIfAborted } from "../tool-errors"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { ToolError, throwIfAborted } from "$c/core/tool-errors"; +import { getLanguageFromPath, type Theme } from "$c/modes/interactive/theme/theme"; import type { ToolSession } from "./index"; import { applyListLimit } from "./list-limit"; import { resolveToCwd } from "./path-utils"; diff --git a/packages/coding-agent/src/core/tools/lsp/client.ts b/packages/coding-agent/src/core/tools/lsp/client.ts index 94bfb927b..53fbe68f4 100644 --- a/packages/coding-agent/src/core/tools/lsp/client.ts +++ b/packages/coding-agent/src/core/tools/lsp/client.ts @@ -1,6 +1,6 @@ import * as fs from "node:fs"; import { logger } from "@oh-my-pi/pi-utils"; -import { ToolAbortError, throwIfAborted } from "../../tool-errors"; +import { ToolAbortError, throwIfAborted } from "$c/core/tool-errors"; import { applyWorkspaceEdit } from "./edits"; import { getLspmuxCommand, isLspmuxSupported } from "./lspmux"; import type { diff --git a/packages/coding-agent/src/core/tools/lsp/clients/biome-client.ts b/packages/coding-agent/src/core/tools/lsp/clients/biome-client.ts index e0b662b15..2919b1fd4 100644 --- a/packages/coding-agent/src/core/tools/lsp/clients/biome-client.ts +++ b/packages/coding-agent/src/core/tools/lsp/clients/biome-client.ts @@ -4,7 +4,7 @@ */ import path from "node:path"; -import type { Diagnostic, DiagnosticSeverity, LinterClient, ServerConfig } from "../types"; +import type { Diagnostic, DiagnosticSeverity, LinterClient, ServerConfig } from "$c/core/tools/lsp/types"; // ============================================================================= // Biome JSON Output Types diff --git a/packages/coding-agent/src/core/tools/lsp/clients/index.ts b/packages/coding-agent/src/core/tools/lsp/clients/index.ts index bdbc416ad..bb06ee13b 100644 --- a/packages/coding-agent/src/core/tools/lsp/clients/index.ts +++ b/packages/coding-agent/src/core/tools/lsp/clients/index.ts @@ -8,7 +8,7 @@ export { BiomeClient } from "./biome-client"; export { LspLinterClient } from "./lsp-linter-client"; -import type { LinterClient, ServerConfig } from "../types"; +import type { LinterClient, ServerConfig } from "$c/core/tools/lsp/types"; import { LspLinterClient } from "./lsp-linter-client"; // Cache of linter clients by server name + cwd diff --git a/packages/coding-agent/src/core/tools/lsp/clients/lsp-linter-client.ts b/packages/coding-agent/src/core/tools/lsp/clients/lsp-linter-client.ts index e983b8131..99d99adfc 100644 --- a/packages/coding-agent/src/core/tools/lsp/clients/lsp-linter-client.ts +++ b/packages/coding-agent/src/core/tools/lsp/clients/lsp-linter-client.ts @@ -3,10 +3,10 @@ * Uses the Language Server Protocol for formatting and diagnostics. */ -import { getOrCreateClient, notifySaved, sendRequest, syncContent } from "../client"; -import { applyTextEditsToString } from "../edits"; -import type { Diagnostic, LinterClient, LspClient, ServerConfig, TextEdit } from "../types"; -import { fileToUri } from "../utils"; +import { getOrCreateClient, notifySaved, sendRequest, syncContent } from "$c/core/tools/lsp/client"; +import { applyTextEditsToString } from "$c/core/tools/lsp/edits"; +import type { Diagnostic, LinterClient, LspClient, ServerConfig, TextEdit } from "$c/core/tools/lsp/types"; +import { fileToUri } from "$c/core/tools/lsp/utils"; /** Default formatting options for LSP */ const DEFAULT_FORMAT_OPTIONS = { diff --git a/packages/coding-agent/src/core/tools/lsp/config.ts b/packages/coding-agent/src/core/tools/lsp/config.ts index 7df824e84..2e592d5d2 100644 --- a/packages/coding-agent/src/core/tools/lsp/config.ts +++ b/packages/coding-agent/src/core/tools/lsp/config.ts @@ -3,7 +3,7 @@ import { basename, extname, join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import { YAML } from "bun"; import { globSync } from "glob"; -import { getConfigDirPaths } from "../../../config"; +import { getConfigDirPaths } from "$c/config"; import { BiomeClient } from "./clients/biome-client"; import DEFAULTS from "./defaults.json" with { type: "json" }; import type { ServerConfig } from "./types"; diff --git a/packages/coding-agent/src/core/tools/lsp/index.ts b/packages/coding-agent/src/core/tools/lsp/index.ts index 7c2e8617e..27fba1b6b 100644 --- a/packages/coding-agent/src/core/tools/lsp/index.ts +++ b/packages/coding-agent/src/core/tools/lsp/index.ts @@ -4,12 +4,12 @@ import path from "node:path"; import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import { logger, once, untilAborted } from "@oh-my-pi/pi-utils"; import type { BunFile } from "bun"; -import { type Theme, theme } from "../../../modes/interactive/theme/theme"; -import lspDescription from "../../../prompts/tools/lsp.md" with { type: "text" }; -import { renderPromptTemplate } from "../../prompt-templates"; -import { throwIfAborted } from "../../tool-errors"; -import type { ToolSession } from "../index"; -import { resolveToCwd } from "../path-utils"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { throwIfAborted } from "$c/core/tool-errors"; +import type { ToolSession } from "$c/core/tools/index"; +import { resolveToCwd } from "$c/core/tools/path-utils"; +import { type Theme, theme } from "$c/modes/interactive/theme/theme"; +import lspDescription from "$c/prompts/tools/lsp.md" with { type: "text" }; import { ensureFileOpen, getActiveClients, diff --git a/packages/coding-agent/src/core/tools/lsp/render.ts b/packages/coding-agent/src/core/tools/lsp/render.ts index 9a02e9338..f4706a849 100644 --- a/packages/coding-agent/src/core/tools/lsp/render.ts +++ b/packages/coding-agent/src/core/tools/lsp/render.ts @@ -11,8 +11,8 @@ import type { AgentToolResult, RenderResultOptions } from "@oh-my-pi/pi-agent-core"; import { Text } from "@oh-my-pi/pi-tui"; import { highlight, supportsLanguage } from "cli-highlight"; -import { getLanguageFromPath, type Theme } from "../../../modes/interactive/theme/theme"; -import { formatExpandHint, formatMoreItems, TRUNCATE_LENGTHS, truncate } from "../render-utils"; +import { formatExpandHint, formatMoreItems, TRUNCATE_LENGTHS, truncate } from "$c/core/tools/render-utils"; +import { getLanguageFromPath, type Theme } from "$c/modes/interactive/theme/theme"; import type { LspParams, LspToolDetails } from "./types"; // ============================================================================= diff --git a/packages/coding-agent/src/core/tools/lsp/utils.ts b/packages/coding-agent/src/core/tools/lsp/utils.ts index 821385c5c..ac85faa31 100644 --- a/packages/coding-agent/src/core/tools/lsp/utils.ts +++ b/packages/coding-agent/src/core/tools/lsp/utils.ts @@ -1,5 +1,5 @@ import path from "node:path"; -import { type Theme, theme } from "../../../modes/interactive/theme/theme"; +import { type Theme, theme } from "$c/modes/interactive/theme/theme"; import type { Diagnostic, DiagnosticSeverity, diff --git a/packages/coding-agent/src/core/tools/notebook.ts b/packages/coding-agent/src/core/tools/notebook.ts index bb03cf1e2..6321a94be 100644 --- a/packages/coding-agent/src/core/tools/notebook.ts +++ b/packages/coding-agent/src/core/tools/notebook.ts @@ -4,9 +4,9 @@ import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; import { untilAborted } from "@oh-my-pi/pi-utils"; import { type Static, Type } from "@sinclair/typebox"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { ToolSession } from "../sdk"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { ToolSession } from "$c/core/sdk"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import { resolveToCwd } from "./path-utils"; import { formatCount, diff --git a/packages/coding-agent/src/core/tools/output-utils.ts b/packages/coding-agent/src/core/tools/output-utils.ts index 14109928a..3490a62ca 100644 --- a/packages/coding-agent/src/core/tools/output-utils.ts +++ b/packages/coding-agent/src/core/tools/output-utils.ts @@ -1,4 +1,4 @@ -import { ArtifactManager } from "../artifacts"; +import { ArtifactManager } from "$c/core/artifacts"; import type { ToolSession } from "./index"; export interface TailBuffer { diff --git a/packages/coding-agent/src/core/tools/patch/applicator.ts b/packages/coding-agent/src/core/tools/patch/applicator.ts index eb4dd5843..c7c38c7fa 100644 --- a/packages/coding-agent/src/core/tools/patch/applicator.ts +++ b/packages/coding-agent/src/core/tools/patch/applicator.ts @@ -7,7 +7,7 @@ import { mkdirSync, unlinkSync } from "node:fs"; import { dirname } from "node:path"; -import { resolveToCwd } from "../path-utils"; +import { resolveToCwd } from "$c/core/tools/path-utils"; import { DEFAULT_FUZZY_THRESHOLD, findContextLine, findMatch, seekSequence } from "./fuzzy"; import { adjustIndentation, diff --git a/packages/coding-agent/src/core/tools/patch/diff.ts b/packages/coding-agent/src/core/tools/patch/diff.ts index 5636c984a..20b866300 100644 --- a/packages/coding-agent/src/core/tools/patch/diff.ts +++ b/packages/coding-agent/src/core/tools/patch/diff.ts @@ -6,7 +6,7 @@ */ import * as Diff from "diff"; -import { resolveToCwd } from "../path-utils"; +import { resolveToCwd } from "$c/core/tools/path-utils"; import { previewPatch } from "./applicator"; import { DEFAULT_FUZZY_THRESHOLD, findMatch } from "./fuzzy"; import { adjustIndentation, normalizeToLF, stripBom } from "./normalize"; diff --git a/packages/coding-agent/src/core/tools/patch/index.ts b/packages/coding-agent/src/core/tools/patch/index.ts index 9834b8642..65971fc4f 100644 --- a/packages/coding-agent/src/core/tools/patch/index.ts +++ b/packages/coding-agent/src/core/tools/patch/index.ts @@ -12,19 +12,19 @@ import { mkdir } from "node:fs/promises"; import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import { StringEnum } from "@oh-my-pi/pi-ai"; import { Type } from "@sinclair/typebox"; -import patchDescription from "../../../prompts/tools/patch.md" with { type: "text" }; -import replaceDescription from "../../../prompts/tools/replace.md" with { type: "text" }; -import { outputMeta } from "../../output-meta"; -import { renderPromptTemplate } from "../../prompt-templates"; -import type { ToolSession } from "../index"; +import { outputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { ToolSession } from "$c/core/tools/index"; import { createLspWritethrough, type FileDiagnosticsResult, flushLspWritethroughBatch, type WritethroughCallback, writethroughNoop, -} from "../lsp/index"; -import { resolveToCwd } from "../path-utils"; +} from "$c/core/tools/lsp/index"; +import { resolveToCwd } from "$c/core/tools/path-utils"; +import patchDescription from "$c/prompts/tools/patch.md" with { type: "text" }; +import replaceDescription from "$c/prompts/tools/replace.md" with { type: "text" }; import { applyPatch } from "./applicator"; import { generateDiffString, generateUnifiedDiffString, replaceText } from "./diff"; import { DEFAULT_FUZZY_THRESHOLD, findMatch } from "./fuzzy"; diff --git a/packages/coding-agent/src/core/tools/patch/shared.ts b/packages/coding-agent/src/core/tools/patch/shared.ts index f7801e8ca..60aa189be 100644 --- a/packages/coding-agent/src/core/tools/patch/shared.ts +++ b/packages/coding-agent/src/core/tools/patch/shared.ts @@ -5,11 +5,9 @@ import type { ToolCallContext } from "@oh-my-pi/pi-agent-core"; import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; -import { renderDiff as renderDiffColored } from "../../../modes/interactive/components/diff"; -import { getLanguageFromPath, type Theme } from "../../../modes/interactive/theme/theme"; -import type { RenderResultOptions } from "../../custom-tools/types"; -import type { OutputMeta } from "../../output-meta"; -import type { FileDiagnosticsResult } from "../lsp/index"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import type { FileDiagnosticsResult } from "$c/core/tools/lsp/index"; import { formatExpandHint, formatStatusIcon, @@ -17,8 +15,10 @@ import { shortenPath, ToolUIKit, truncateDiffByHunk, -} from "../render-utils"; -import type { RenderCallOptions } from "../renderers"; +} from "$c/core/tools/render-utils"; +import type { RenderCallOptions } from "$c/core/tools/renderers"; +import { renderDiff as renderDiffColored } from "$c/modes/interactive/components/diff"; +import { getLanguageFromPath, type Theme } from "$c/modes/interactive/theme/theme"; import type { DiffError, DiffResult, Operation } from "./types"; // ═══════════════════════════════════════════════════════════════════════════ diff --git a/packages/coding-agent/src/core/tools/python.ts b/packages/coding-agent/src/core/tools/python.ts index 3e3c168fb..00cb6ceed 100644 --- a/packages/coding-agent/src/core/tools/python.ts +++ b/packages/coding-agent/src/core/tools/python.ts @@ -4,16 +4,16 @@ import type { ImageContent } from "@oh-my-pi/pi-ai"; import type { Component } from "@oh-my-pi/pi-tui"; import { Text, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui"; import { type Static, Type } from "@sinclair/typebox"; -import { truncateToVisualLines } from "../../modes/interactive/components/visual-truncate"; -import { highlightCode, type Theme } from "../../modes/interactive/theme/theme"; -import pythonDescription from "../../prompts/tools/python.md" with { type: "text" }; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import { executePython, getPreludeDocs, type PythonExecutorOptions } from "../python-executor"; -import type { PreludeHelper, PythonStatusEvent } from "../python-kernel"; -import { OutputSink, type OutputSummary } from "../streaming-output"; -import { ToolAbortError, ToolError } from "../tool-errors"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { executePython, getPreludeDocs, type PythonExecutorOptions } from "$c/core/python-executor"; +import type { PreludeHelper, PythonStatusEvent } from "$c/core/python-kernel"; +import { OutputSink, type OutputSummary } from "$c/core/streaming-output"; +import { ToolAbortError, ToolError } from "$c/core/tool-errors"; +import { truncateToVisualLines } from "$c/modes/interactive/components/visual-truncate"; +import { highlightCode, type Theme } from "$c/modes/interactive/theme/theme"; +import pythonDescription from "$c/prompts/tools/python.md" with { type: "text" }; import type { ToolSession } from "./index"; import { allocateOutputArtifact, createTailBuffer } from "./output-utils"; import { resolveToCwd } from "./path-utils"; diff --git a/packages/coding-agent/src/core/tools/read.ts b/packages/coding-agent/src/core/tools/read.ts index caa3c2d18..dbf2cd07c 100644 --- a/packages/coding-agent/src/core/tools/read.ts +++ b/packages/coding-agent/src/core/tools/read.ts @@ -6,17 +6,17 @@ import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; import { ptree } from "@oh-my-pi/pi-utils"; import { Type } from "@sinclair/typebox"; -import { CONFIG_DIR_NAME } from "../../config"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import readDescription from "../../prompts/tools/read.md" with { type: "text" }; -import { formatDimensionNote, resizeImage } from "../../utils/image-resize"; -import { detectSupportedImageMimeTypeFromFile } from "../../utils/mime"; -import { ensureTool } from "../../utils/tools-manager"; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import type { ToolSession } from "../sdk"; -import { ToolAbortError, ToolError, throwIfAborted } from "../tool-errors"; +import { CONFIG_DIR_NAME } from "$c/config"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { ToolSession } from "$c/core/sdk"; +import { ToolAbortError, ToolError, throwIfAborted } from "$c/core/tool-errors"; +import type { Theme } from "$c/modes/interactive/theme/theme"; +import readDescription from "$c/prompts/tools/read.md" with { type: "text" }; +import { formatDimensionNote, resizeImage } from "$c/utils/image-resize"; +import { detectSupportedImageMimeTypeFromFile } from "$c/utils/mime"; +import { ensureTool } from "$c/utils/tools-manager"; import { runFd } from "./find"; import { applyListLimit } from "./list-limit"; import { LsTool } from "./ls"; diff --git a/packages/coding-agent/src/core/tools/render-utils.ts b/packages/coding-agent/src/core/tools/render-utils.ts index 1ff400b4a..e207a4760 100644 --- a/packages/coding-agent/src/core/tools/render-utils.ts +++ b/packages/coding-agent/src/core/tools/render-utils.ts @@ -6,7 +6,7 @@ */ import { homedir } from "node:os"; -import type { Theme } from "../../modes/interactive/theme/theme"; +import type { Theme } from "$c/modes/interactive/theme/theme"; // ============================================================================= // Standardized Display Constants diff --git a/packages/coding-agent/src/core/tools/renderers.ts b/packages/coding-agent/src/core/tools/renderers.ts index d34e25dce..c68bf9fec 100644 --- a/packages/coding-agent/src/core/tools/renderers.ts +++ b/packages/coding-agent/src/core/tools/renderers.ts @@ -5,8 +5,8 @@ */ import type { Component } from "@oh-my-pi/pi-tui"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import type { RenderResultOptions } from "../custom-tools/types"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import { askToolRenderer } from "./ask"; import { bashToolRenderer } from "./bash"; import { calculatorToolRenderer } from "./calculator"; diff --git a/packages/coding-agent/src/core/tools/review.ts b/packages/coding-agent/src/core/tools/review.ts index 840ae46dc..d0ea148cf 100644 --- a/packages/coding-agent/src/core/tools/review.ts +++ b/packages/coding-agent/src/core/tools/review.ts @@ -10,7 +10,7 @@ import type { AgentTool } from "@oh-my-pi/pi-agent-core"; import type { Component } from "@oh-my-pi/pi-tui"; import { Container, Text } from "@oh-my-pi/pi-tui"; import { Type } from "@sinclair/typebox"; -import type { Theme, ThemeColor } from "../../modes/interactive/theme/theme"; +import type { Theme, ThemeColor } from "$c/modes/interactive/theme/theme"; export type FindingPriority = "P0" | "P1" | "P2" | "P3"; diff --git a/packages/coding-agent/src/core/tools/ssh.ts b/packages/coding-agent/src/core/tools/ssh.ts index 007427173..9a4e7a7fd 100644 --- a/packages/coding-agent/src/core/tools/ssh.ts +++ b/packages/coding-agent/src/core/tools/ssh.ts @@ -2,18 +2,18 @@ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallb import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; import { Type } from "@sinclair/typebox"; -import type { SSHHost } from "../../capability/ssh"; -import { sshCapability } from "../../capability/ssh"; -import { loadCapability } from "../../discovery/index"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import sshDescriptionBase from "../../prompts/tools/ssh.md" with { type: "text" }; -import type { RenderResultOptions } from "../custom-tools/types"; -import type { OutputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import type { SSHHostInfo } from "../ssh/connection-manager"; -import { ensureHostInfo, getHostInfoForHost } from "../ssh/connection-manager"; -import { executeSSH } from "../ssh/ssh-executor"; -import { ToolError } from "../tool-errors"; +import type { SSHHost } from "$c/capability/ssh"; +import { sshCapability } from "$c/capability/ssh"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import type { OutputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { SSHHostInfo } from "$c/core/ssh/connection-manager"; +import { ensureHostInfo, getHostInfoForHost } from "$c/core/ssh/connection-manager"; +import { executeSSH } from "$c/core/ssh/ssh-executor"; +import { ToolError } from "$c/core/tool-errors"; +import { loadCapability } from "$c/discovery/index"; +import type { Theme } from "$c/modes/interactive/theme/theme"; +import sshDescriptionBase from "$c/prompts/tools/ssh.md" with { type: "text" }; import type { ToolSession } from "./index"; import { allocateOutputArtifact, createTailBuffer } from "./output-utils"; import { ToolUIKit } from "./render-utils"; diff --git a/packages/coding-agent/src/core/tools/task/agents.ts b/packages/coding-agent/src/core/tools/task/agents.ts index 5a3d59191..a3146b43a 100644 --- a/packages/coding-agent/src/core/tools/task/agents.ts +++ b/packages/coding-agent/src/core/tools/task/agents.ts @@ -4,15 +4,15 @@ * Agents are embedded at build time via Bun's import with { type: "text" }. */ -import { parseFrontmatter } from "../../../core/frontmatter"; -import { parseAgentFields } from "../../../discovery/helpers"; -import exploreMd from "../../../prompts/agents/explore.md" with { type: "text" }; +import { parseFrontmatter } from "$c/core/frontmatter"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { parseAgentFields } from "$c/discovery/helpers"; +import exploreMd from "$c/prompts/agents/explore.md" with { type: "text" }; // Embed agent markdown files at build time -import agentFrontmatterTemplate from "../../../prompts/agents/frontmatter.md" with { type: "text" }; -import planMd from "../../../prompts/agents/plan.md" with { type: "text" }; -import reviewerMd from "../../../prompts/agents/reviewer.md" with { type: "text" }; -import taskMd from "../../../prompts/agents/task.md" with { type: "text" }; -import { renderPromptTemplate } from "../../prompt-templates"; +import agentFrontmatterTemplate from "$c/prompts/agents/frontmatter.md" with { type: "text" }; +import planMd from "$c/prompts/agents/plan.md" with { type: "text" }; +import reviewerMd from "$c/prompts/agents/reviewer.md" with { type: "text" }; +import taskMd from "$c/prompts/agents/task.md" with { type: "text" }; import type { AgentDefinition, AgentSource } from "./types"; interface AgentFrontmatter { diff --git a/packages/coding-agent/src/core/tools/task/commands.ts b/packages/coding-agent/src/core/tools/task/commands.ts index e3bf4f1dc..0415cb339 100644 --- a/packages/coding-agent/src/core/tools/task/commands.ts +++ b/packages/coding-agent/src/core/tools/task/commands.ts @@ -5,13 +5,12 @@ */ import * as path from "node:path"; -import { type SlashCommand, slashCommandCapability } from "../../../capability/slash-command"; -import { parseFrontmatter } from "../../../core/frontmatter"; -import { loadCapability } from "../../../discovery"; - +import { type SlashCommand, slashCommandCapability } from "$c/capability/slash-command"; +import { parseFrontmatter } from "$c/core/frontmatter"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { loadCapability } from "$c/discovery"; // Embed command markdown files at build time -import initMd from "../../../prompts/agents/init.md" with { type: "text" }; -import { renderPromptTemplate } from "../../prompt-templates"; +import initMd from "$c/prompts/agents/init.md" with { type: "text" }; const EMBEDDED_COMMANDS: { name: string; content: string }[] = [ { name: "init.md", content: renderPromptTemplate(initMd) }, diff --git a/packages/coding-agent/src/core/tools/task/discovery.ts b/packages/coding-agent/src/core/tools/task/discovery.ts index 688e6c4a0..f36793f5c 100644 --- a/packages/coding-agent/src/core/tools/task/discovery.ts +++ b/packages/coding-agent/src/core/tools/task/discovery.ts @@ -14,9 +14,9 @@ import * as fs from "node:fs"; import * as path from "node:path"; -import { findAllNearestProjectConfigDirs, getConfigDirs } from "../../../config"; -import { parseFrontmatter } from "../../../core/frontmatter"; -import { parseAgentFields } from "../../../discovery/helpers"; +import { findAllNearestProjectConfigDirs, getConfigDirs } from "$c/config"; +import { parseFrontmatter } from "$c/core/frontmatter"; +import { parseAgentFields } from "$c/discovery/helpers"; import { loadBundledAgents } from "./agents"; import type { AgentDefinition, AgentSource } from "./types"; diff --git a/packages/coding-agent/src/core/tools/task/executor.ts b/packages/coding-agent/src/core/tools/task/executor.ts index 47087165e..d50405f89 100644 --- a/packages/coding-agent/src/core/tools/task/executor.ts +++ b/packages/coding-agent/src/core/tools/task/executor.ts @@ -6,17 +6,17 @@ import path from "node:path"; import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core"; -import type { AuthStorage } from "../../auth-storage"; -import type { EventBus } from "../../event-bus"; -import { callTool } from "../../mcp/client"; -import type { MCPManager } from "../../mcp/manager"; -import type { ModelRegistry } from "../../model-registry"; -import { formatModelString, parseModelPattern } from "../../model-resolver"; -import { checkPythonKernelAvailability } from "../../python-kernel"; +import type { AuthStorage } from "$c/core/auth-storage"; +import type { EventBus } from "$c/core/event-bus"; +import { callTool } from "$c/core/mcp/client"; +import type { MCPManager } from "$c/core/mcp/manager"; +import type { ModelRegistry } from "$c/core/model-registry"; +import { formatModelString, parseModelPattern } from "$c/core/model-resolver"; +import { checkPythonKernelAvailability } from "$c/core/python-kernel"; +import { LspTool } from "$c/core/tools/lsp/index"; +import type { LspParams } from "$c/core/tools/lsp/types"; +import { PythonTool, type PythonToolParams } from "$c/core/tools/python"; import type { ToolSession } from ".."; -import { LspTool } from "../lsp/index"; -import type { LspParams } from "../lsp/types"; -import { PythonTool, type PythonToolParams } from "../python"; import { subprocessToolRegistry } from "./subprocess-tool-registry"; import { type AgentDefinition, diff --git a/packages/coding-agent/src/core/tools/task/index.ts b/packages/coding-agent/src/core/tools/task/index.ts index e8c9ec501..12bcd6c96 100644 --- a/packages/coding-agent/src/core/tools/task/index.ts +++ b/packages/coding-agent/src/core/tools/task/index.ts @@ -20,11 +20,11 @@ import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@oh-my import type { Usage } from "@oh-my-pi/pi-ai"; import { $ } from "bun"; import { nanoid } from "nanoid"; -import type { Theme } from "../../../modes/interactive/theme/theme"; -import taskDescriptionTemplate from "../../../prompts/tools/task.md" with { type: "text" }; -import { renderPromptTemplate } from "../../prompt-templates"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { formatDuration } from "$c/core/tools/render-utils"; +import type { Theme } from "$c/modes/interactive/theme/theme"; +import taskDescriptionTemplate from "$c/prompts/tools/task.md" with { type: "text" }; import type { ToolSession } from ".."; -import { formatDuration } from "../render-utils"; import { discoverAgents, getAgent } from "./discovery"; import { runSubprocess } from "./executor"; import { mapWithConcurrencyLimit } from "./parallel"; diff --git a/packages/coding-agent/src/core/tools/task/render.ts b/packages/coding-agent/src/core/tools/task/render.ts index bf03fcb02..4b660d39e 100644 --- a/packages/coding-agent/src/core/tools/task/render.ts +++ b/packages/coding-agent/src/core/tools/task/render.ts @@ -8,8 +8,7 @@ import path from "node:path"; import type { Component } from "@oh-my-pi/pi-tui"; import { Container, Text } from "@oh-my-pi/pi-tui"; -import type { Theme } from "../../../modes/interactive/theme/theme"; -import type { RenderResultOptions } from "../../custom-tools/types"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; import { formatBadge, formatDuration, @@ -17,14 +16,15 @@ import { formatStatusIcon, formatTokens, truncate, -} from "../render-utils"; +} from "$c/core/tools/render-utils"; import { type FindingPriority, getPriorityInfo, PRIORITY_LABELS, type ReportFindingDetails, type SubmitReviewDetails, -} from "../review"; +} from "$c/core/tools/review"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import { subprocessToolRegistry } from "./subprocess-tool-registry"; import type { AgentProgress, SingleResult, TaskParams, TaskToolDetails } from "./types"; diff --git a/packages/coding-agent/src/core/tools/task/subprocess-tool-registry.ts b/packages/coding-agent/src/core/tools/task/subprocess-tool-registry.ts index 2a3fd92c5..3c685ee1d 100644 --- a/packages/coding-agent/src/core/tools/task/subprocess-tool-registry.ts +++ b/packages/coding-agent/src/core/tools/task/subprocess-tool-registry.ts @@ -8,7 +8,7 @@ */ import type { Component } from "@oh-my-pi/pi-tui"; -import type { Theme } from "../../../modes/interactive/theme/theme"; +import type { Theme } from "$c/modes/interactive/theme/theme"; /** Event from subprocess tool execution (parsed from JSONL) */ export interface SubprocessToolEvent { diff --git a/packages/coding-agent/src/core/tools/task/worker-protocol.ts b/packages/coding-agent/src/core/tools/task/worker-protocol.ts index 280220ca0..9c4d77cd2 100644 --- a/packages/coding-agent/src/core/tools/task/worker-protocol.ts +++ b/packages/coding-agent/src/core/tools/task/worker-protocol.ts @@ -1,7 +1,7 @@ import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core"; -import type { SerializedAuthStorage } from "../../auth-storage"; -import type { SerializedModelRegistry } from "../../model-registry"; -import type { Settings } from "../../settings-manager"; +import type { SerializedAuthStorage } from "$c/core/auth-storage"; +import type { SerializedModelRegistry } from "$c/core/model-registry"; +import type { Settings } from "$c/core/settings-manager"; /** * MCP tool metadata passed from parent to worker for proxy tool creation. diff --git a/packages/coding-agent/src/core/tools/task/worker.ts b/packages/coding-agent/src/core/tools/task/worker.ts index 7f52e1c9e..deda4db26 100644 --- a/packages/coding-agent/src/core/tools/task/worker.ts +++ b/packages/coding-agent/src/core/tools/task/worker.ts @@ -17,19 +17,24 @@ import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import type { Api, Model } from "@oh-my-pi/pi-ai"; import { logger, postmortem, untilAborted } from "@oh-my-pi/pi-utils"; import type { TSchema } from "@sinclair/typebox"; -import lspDescription from "../../../prompts/tools/lsp.md" with { type: "text" }; -import type { AgentSessionEvent } from "../../agent-session"; -import { AuthStorage } from "../../auth-storage"; -import type { CustomTool } from "../../custom-tools/types"; -import { ModelRegistry } from "../../model-registry"; -import { parseModelPattern, parseModelString } from "../../model-resolver"; -import { renderPromptTemplate } from "../../prompt-templates"; -import { createAgentSession, discoverAuthStorage, discoverModels } from "../../sdk"; -import { SessionManager } from "../../session-manager"; -import { SettingsManager } from "../../settings-manager"; -import { ToolAbortError } from "../../tool-errors"; -import { type LspToolDetails, lspSchema } from "../lsp/types"; -import { getPythonToolDescription, type PythonToolDetails, type PythonToolParams, pythonSchema } from "../python"; +import type { AgentSessionEvent } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; +import type { CustomTool } from "$c/core/custom-tools/types"; +import { ModelRegistry } from "$c/core/model-registry"; +import { parseModelPattern, parseModelString } from "$c/core/model-resolver"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { createAgentSession, discoverAuthStorage, discoverModels } from "$c/core/sdk"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; +import { ToolAbortError } from "$c/core/tool-errors"; +import { type LspToolDetails, lspSchema } from "$c/core/tools/lsp/types"; +import { + getPythonToolDescription, + type PythonToolDetails, + type PythonToolParams, + pythonSchema, +} from "$c/core/tools/python"; +import lspDescription from "$c/prompts/tools/lsp.md" with { type: "text" }; import type { LspToolCallResponse, MCPToolCallResponse, diff --git a/packages/coding-agent/src/core/tools/todo-write.ts b/packages/coding-agent/src/core/tools/todo-write.ts index 368743f97..1b0706751 100644 --- a/packages/coding-agent/src/core/tools/todo-write.ts +++ b/packages/coding-agent/src/core/tools/todo-write.ts @@ -7,11 +7,11 @@ import { Text } from "@oh-my-pi/pi-tui"; import { logger } from "@oh-my-pi/pi-utils"; import { Type } from "@sinclair/typebox"; import chalk from "chalk"; -import type { Theme } from "../../modes/interactive/theme/theme"; -import todoWriteDescription from "../../prompts/tools/todo-write.md" with { type: "text" }; -import type { RenderResultOptions } from "../custom-tools/types"; -import { renderPromptTemplate } from "../prompt-templates"; -import type { ToolSession } from "../sdk"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { ToolSession } from "$c/core/sdk"; +import type { Theme } from "$c/modes/interactive/theme/theme"; +import todoWriteDescription from "$c/prompts/tools/todo-write.md" with { type: "text" }; const todoWriteSchema = Type.Object({ todos: Type.Array( diff --git a/packages/coding-agent/src/core/tools/tool-result.ts b/packages/coding-agent/src/core/tools/tool-result.ts index 807a5de23..d2c6c8783 100644 --- a/packages/coding-agent/src/core/tools/tool-result.ts +++ b/packages/coding-agent/src/core/tools/tool-result.ts @@ -1,8 +1,13 @@ import type { AgentToolResult } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai"; -import type { OutputMeta, TruncationOptions, TruncationSummaryOptions, TruncationTextOptions } from "../output-meta"; -import { outputMeta } from "../output-meta"; -import type { OutputSummary } from "../streaming-output"; +import type { + OutputMeta, + TruncationOptions, + TruncationSummaryOptions, + TruncationTextOptions, +} from "$c/core/output-meta"; +import { outputMeta } from "$c/core/output-meta"; +import type { OutputSummary } from "$c/core/streaming-output"; import type { TruncationResult } from "./truncate"; type ToolContent = Array; diff --git a/packages/coding-agent/src/core/tools/web-scrapers/choosealicense.ts b/packages/coding-agent/src/core/tools/web-scrapers/choosealicense.ts index f37184510..d2b665c60 100644 --- a/packages/coding-agent/src/core/tools/web-scrapers/choosealicense.ts +++ b/packages/coding-agent/src/core/tools/web-scrapers/choosealicense.ts @@ -1,4 +1,4 @@ -import { parseFrontmatter } from "../../../core/frontmatter"; +import { parseFrontmatter } from "$c/core/frontmatter"; import type { RenderResult, SpecialHandler } from "./types"; import { finalizeOutput, loadPage } from "./types"; diff --git a/packages/coding-agent/src/core/tools/web-scrapers/twitter.ts b/packages/coding-agent/src/core/tools/web-scrapers/twitter.ts index db62d9fe3..af9c4ecaf 100644 --- a/packages/coding-agent/src/core/tools/web-scrapers/twitter.ts +++ b/packages/coding-agent/src/core/tools/web-scrapers/twitter.ts @@ -1,5 +1,5 @@ import { parse as parseHtml } from "node-html-parser"; -import { ToolAbortError } from "../../tool-errors"; +import { ToolAbortError } from "$c/core/tool-errors"; import type { RenderResult, SpecialHandler } from "./types"; import { finalizeOutput, loadPage } from "./types"; diff --git a/packages/coding-agent/src/core/tools/web-scrapers/types.ts b/packages/coding-agent/src/core/tools/web-scrapers/types.ts index 742d3224d..f34984429 100644 --- a/packages/coding-agent/src/core/tools/web-scrapers/types.ts +++ b/packages/coding-agent/src/core/tools/web-scrapers/types.ts @@ -2,7 +2,7 @@ * Shared types and utilities for web-fetch handlers */ -import { ToolAbortError } from "../../tool-errors"; +import { ToolAbortError } from "$c/core/tool-errors"; export interface RenderResult { url: string; diff --git a/packages/coding-agent/src/core/tools/web-scrapers/utils.ts b/packages/coding-agent/src/core/tools/web-scrapers/utils.ts index fc3ebad07..6acaf9fca 100644 --- a/packages/coding-agent/src/core/tools/web-scrapers/utils.ts +++ b/packages/coding-agent/src/core/tools/web-scrapers/utils.ts @@ -3,7 +3,7 @@ import { tmpdir } from "node:os"; import * as path from "node:path"; import { ptree } from "@oh-my-pi/pi-utils"; import { nanoid } from "nanoid"; -import { ensureTool } from "../../../utils/tools-manager"; +import { ensureTool } from "$c/utils/tools-manager"; import { createRequestSignal } from "./types"; const MAX_BYTES = 50 * 1024 * 1024; // 50MB for binary files diff --git a/packages/coding-agent/src/core/tools/web-scrapers/youtube.ts b/packages/coding-agent/src/core/tools/web-scrapers/youtube.ts index 9fe111952..4a86eabdb 100644 --- a/packages/coding-agent/src/core/tools/web-scrapers/youtube.ts +++ b/packages/coding-agent/src/core/tools/web-scrapers/youtube.ts @@ -3,8 +3,8 @@ import { tmpdir } from "node:os"; import path from "node:path"; import { cspawn } from "@oh-my-pi/pi-utils"; import { nanoid } from "nanoid"; -import { ensureTool } from "../../../utils/tools-manager"; -import { throwIfAborted } from "../../tool-errors"; +import { throwIfAborted } from "$c/core/tool-errors"; +import { ensureTool } from "$c/utils/tools-manager"; import type { RenderResult, SpecialHandler } from "./types"; import { finalizeOutput } from "./types"; diff --git a/packages/coding-agent/src/core/tools/web-search/auth.ts b/packages/coding-agent/src/core/tools/web-search/auth.ts index b21335c97..0e6772422 100644 --- a/packages/coding-agent/src/core/tools/web-search/auth.ts +++ b/packages/coding-agent/src/core/tools/web-search/auth.ts @@ -12,10 +12,10 @@ import * as os from "node:os"; import * as path from "node:path"; import { buildAnthropicHeaders as buildProviderAnthropicHeaders } from "@oh-my-pi/pi-ai"; import { logger } from "@oh-my-pi/pi-utils"; -import { getAgentDbPath, getConfigDirPaths } from "../../../config"; -import { AgentStorage } from "../../agent-storage"; -import type { AuthCredential, AuthCredentialEntry, AuthStorageData } from "../../auth-storage"; -import { migrateJsonStorage } from "../../storage-migration"; +import { getAgentDbPath, getConfigDirPaths } from "$c/config"; +import { AgentStorage } from "$c/core/agent-storage"; +import type { AuthCredential, AuthCredentialEntry, AuthStorageData } from "$c/core/auth-storage"; +import { migrateJsonStorage } from "$c/core/storage-migration"; import type { AnthropicAuthConfig, AnthropicOAuthCredential, ModelsJson } from "./types"; const DEFAULT_BASE_URL = "https://api.anthropic.com"; diff --git a/packages/coding-agent/src/core/tools/web-search/index.ts b/packages/coding-agent/src/core/tools/web-search/index.ts index cf3080679..957d4e796 100644 --- a/packages/coding-agent/src/core/tools/web-search/index.ts +++ b/packages/coding-agent/src/core/tools/web-search/index.ts @@ -15,16 +15,21 @@ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import { StringEnum } from "@oh-my-pi/pi-ai"; import { Type } from "@sinclair/typebox"; -import type { Theme } from "../../../modes/interactive/theme/theme"; -import webSearchSystemPrompt from "../../../prompts/system/web-search.md" with { type: "text" }; -import webSearchDescription from "../../../prompts/tools/web-search.md" with { type: "text" }; -import type { CustomTool, CustomToolContext, RenderResultOptions } from "../../custom-tools/types"; -import { renderPromptTemplate } from "../../prompt-templates"; -import { callExaTool, findApiKey as findExaKey, formatSearchResults, isSearchResponse } from "../exa/mcp-client"; -import { renderExaCall, renderExaResult } from "../exa/render"; -import type { ExaRenderDetails } from "../exa/types"; -import type { ToolSession } from "../index"; -import { formatAge } from "../render-utils"; +import type { CustomTool, CustomToolContext, RenderResultOptions } from "$c/core/custom-tools/types"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import { + callExaTool, + findApiKey as findExaKey, + formatSearchResults, + isSearchResponse, +} from "$c/core/tools/exa/mcp-client"; +import { renderExaCall, renderExaResult } from "$c/core/tools/exa/render"; +import type { ExaRenderDetails } from "$c/core/tools/exa/types"; +import type { ToolSession } from "$c/core/tools/index"; +import { formatAge } from "$c/core/tools/render-utils"; +import type { Theme } from "$c/modes/interactive/theme/theme"; +import webSearchSystemPrompt from "$c/prompts/system/web-search.md" with { type: "text" }; +import webSearchDescription from "$c/prompts/tools/web-search.md" with { type: "text" }; import { findAnthropicAuth } from "./auth"; import { searchAnthropic } from "./providers/anthropic"; import { searchExa } from "./providers/exa"; diff --git a/packages/coding-agent/src/core/tools/web-search/providers/anthropic.ts b/packages/coding-agent/src/core/tools/web-search/providers/anthropic.ts index 359eac119..29658d876 100644 --- a/packages/coding-agent/src/core/tools/web-search/providers/anthropic.ts +++ b/packages/coding-agent/src/core/tools/web-search/providers/anthropic.ts @@ -6,7 +6,7 @@ */ import { applyClaudeToolPrefix, buildAnthropicSystemBlocks, stripClaudeToolPrefix } from "@oh-my-pi/pi-ai"; -import { buildAnthropicHeaders, buildAnthropicUrl, findAnthropicAuth, getEnv } from "../auth"; +import { buildAnthropicHeaders, buildAnthropicUrl, findAnthropicAuth, getEnv } from "$c/core/tools/web-search/auth"; import type { AnthropicApiResponse, AnthropicAuthConfig, @@ -14,8 +14,8 @@ import type { WebSearchCitation, WebSearchResponse, WebSearchSource, -} from "../types"; -import { WebSearchProviderError } from "../types"; +} from "$c/core/tools/web-search/types"; +import { WebSearchProviderError } from "$c/core/tools/web-search/types"; const DEFAULT_MODEL = "claude-haiku-4-5"; const DEFAULT_MAX_TOKENS = 4096; diff --git a/packages/coding-agent/src/core/tools/web-search/providers/exa.ts b/packages/coding-agent/src/core/tools/web-search/providers/exa.ts index 10eac98e3..e9fe6c26a 100644 --- a/packages/coding-agent/src/core/tools/web-search/providers/exa.ts +++ b/packages/coding-agent/src/core/tools/web-search/providers/exa.ts @@ -7,8 +7,8 @@ import { existsSync, readFileSync } from "node:fs"; import { homedir } from "node:os"; -import type { WebSearchResponse, WebSearchSource } from "../types"; -import { WebSearchProviderError } from "../types"; +import type { WebSearchResponse, WebSearchSource } from "$c/core/tools/web-search/types"; +import { WebSearchProviderError } from "$c/core/tools/web-search/types"; const EXA_API_URL = "https://api.exa.ai/search"; diff --git a/packages/coding-agent/src/core/tools/web-search/providers/perplexity.ts b/packages/coding-agent/src/core/tools/web-search/providers/perplexity.ts index dbd9c8924..907542931 100644 --- a/packages/coding-agent/src/core/tools/web-search/providers/perplexity.ts +++ b/packages/coding-agent/src/core/tools/web-search/providers/perplexity.ts @@ -12,8 +12,8 @@ import type { WebSearchCitation, WebSearchResponse, WebSearchSource, -} from "../types"; -import { WebSearchProviderError } from "../types"; +} from "$c/core/tools/web-search/types"; +import { WebSearchProviderError } from "$c/core/tools/web-search/types"; const PERPLEXITY_API_URL = "https://api.perplexity.ai/chat/completions"; diff --git a/packages/coding-agent/src/core/tools/web-search/render.ts b/packages/coding-agent/src/core/tools/web-search/render.ts index cc3dd3441..c88005ca9 100644 --- a/packages/coding-agent/src/core/tools/web-search/render.ts +++ b/packages/coding-agent/src/core/tools/web-search/render.ts @@ -6,8 +6,7 @@ import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; -import type { Theme } from "../../../modes/interactive/theme/theme"; -import type { RenderResultOptions } from "../../custom-tools/types"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; import { formatAge, formatCount, @@ -19,7 +18,8 @@ import { PREVIEW_LIMITS, TRUNCATE_LENGTHS, truncate, -} from "../render-utils"; +} from "$c/core/tools/render-utils"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import type { WebSearchResponse } from "./types"; const MAX_COLLAPSED_ANSWER_LINES = PREVIEW_LIMITS.COLLAPSED_LINES; diff --git a/packages/coding-agent/src/core/tools/write.ts b/packages/coding-agent/src/core/tools/write.ts index 824ef8dfb..784e1df46 100644 --- a/packages/coding-agent/src/core/tools/write.ts +++ b/packages/coding-agent/src/core/tools/write.ts @@ -9,12 +9,12 @@ import type { Component } from "@oh-my-pi/pi-tui"; import { Text } from "@oh-my-pi/pi-tui"; import { untilAborted } from "@oh-my-pi/pi-utils"; import { Type } from "@sinclair/typebox"; -import { getLanguageFromPath, highlightCode, type Theme } from "../../modes/interactive/theme/theme"; -import writeDescription from "../../prompts/tools/write.md" with { type: "text" }; -import type { RenderResultOptions } from "../custom-tools/types"; -import { type OutputMeta, outputMeta } from "../output-meta"; -import { renderPromptTemplate } from "../prompt-templates"; -import type { ToolSession } from "../sdk"; +import type { RenderResultOptions } from "$c/core/custom-tools/types"; +import { type OutputMeta, outputMeta } from "$c/core/output-meta"; +import { renderPromptTemplate } from "$c/core/prompt-templates"; +import type { ToolSession } from "$c/core/sdk"; +import { getLanguageFromPath, highlightCode, type Theme } from "$c/modes/interactive/theme/theme"; +import writeDescription from "$c/prompts/tools/write.md" with { type: "text" }; import { createLspWritethrough, type FileDiagnosticsResult, diff --git a/packages/coding-agent/src/core/ttsr.ts b/packages/coding-agent/src/core/ttsr.ts index 05753d9e1..b215c3e21 100644 --- a/packages/coding-agent/src/core/ttsr.ts +++ b/packages/coding-agent/src/core/ttsr.ts @@ -7,7 +7,7 @@ */ import { logger } from "@oh-my-pi/pi-utils"; -import type { Rule } from "../capability/rule"; +import type { Rule } from "$c/capability/rule"; import type { TtsrSettings } from "./settings-manager"; interface TtsrEntry { diff --git a/packages/coding-agent/src/discovery/agents-md.ts b/packages/coding-agent/src/discovery/agents-md.ts index a661618ac..9543a0fda 100644 --- a/packages/coding-agent/src/discovery/agents-md.ts +++ b/packages/coding-agent/src/discovery/agents-md.ts @@ -7,10 +7,10 @@ */ import { dirname, join, sep } from "node:path"; -import { type ContextFile, contextFileCapability } from "../capability/context-file"; -import { readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import type { LoadContext, LoadResult } from "../capability/types"; +import { type ContextFile, contextFileCapability } from "$c/capability/context-file"; +import { readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import type { LoadContext, LoadResult } from "$c/capability/types"; import { calculateDepth, createSourceMeta } from "./helpers"; const PROVIDER_ID = "agents-md"; diff --git a/packages/coding-agent/src/discovery/builtin.ts b/packages/coding-agent/src/discovery/builtin.ts index d180a0e4a..4314ac479 100644 --- a/packages/coding-agent/src/discovery/builtin.ts +++ b/packages/coding-agent/src/discovery/builtin.ts @@ -6,23 +6,23 @@ */ import { dirname, isAbsolute, join, resolve } from "path"; -import { type ContextFile, contextFileCapability } from "../capability/context-file"; -import { type Extension, type ExtensionManifest, extensionCapability } from "../capability/extension"; -import { type ExtensionModule, extensionModuleCapability } from "../capability/extension-module"; -import { readDirEntries, readFile } from "../capability/fs"; -import { type Hook, hookCapability } from "../capability/hook"; -import { registerProvider } from "../capability/index"; -import { type Instruction, instructionCapability } from "../capability/instruction"; -import { type MCPServer, mcpCapability } from "../capability/mcp"; -import { type Prompt, promptCapability } from "../capability/prompt"; -import { type Rule, ruleCapability } from "../capability/rule"; -import { type Settings, settingsCapability } from "../capability/settings"; -import { type Skill, skillCapability } from "../capability/skill"; -import { type SlashCommand, slashCommandCapability } from "../capability/slash-command"; -import { type SystemPrompt, systemPromptCapability } from "../capability/system-prompt"; -import { type CustomTool, toolCapability } from "../capability/tool"; -import type { LoadContext, LoadResult } from "../capability/types"; -import { parseFrontmatter } from "../core/frontmatter"; +import { type ContextFile, contextFileCapability } from "$c/capability/context-file"; +import { type Extension, type ExtensionManifest, extensionCapability } from "$c/capability/extension"; +import { type ExtensionModule, extensionModuleCapability } from "$c/capability/extension-module"; +import { readDirEntries, readFile } from "$c/capability/fs"; +import { type Hook, hookCapability } from "$c/capability/hook"; +import { registerProvider } from "$c/capability/index"; +import { type Instruction, instructionCapability } from "$c/capability/instruction"; +import { type MCPServer, mcpCapability } from "$c/capability/mcp"; +import { type Prompt, promptCapability } from "$c/capability/prompt"; +import { type Rule, ruleCapability } from "$c/capability/rule"; +import { type Settings, settingsCapability } from "$c/capability/settings"; +import { type Skill, skillCapability } from "$c/capability/skill"; +import { type SlashCommand, slashCommandCapability } from "$c/capability/slash-command"; +import { type SystemPrompt, systemPromptCapability } from "$c/capability/system-prompt"; +import { type CustomTool, toolCapability } from "$c/capability/tool"; +import type { LoadContext, LoadResult } from "$c/capability/types"; +import { parseFrontmatter } from "$c/core/frontmatter"; import { createSourceMeta, discoverExtensionModulePaths, diff --git a/packages/coding-agent/src/discovery/claude.ts b/packages/coding-agent/src/discovery/claude.ts index 8d42ef0ac..d09845b99 100644 --- a/packages/coding-agent/src/discovery/claude.ts +++ b/packages/coding-agent/src/discovery/claude.ts @@ -6,18 +6,18 @@ */ import { join, sep } from "node:path"; -import { type ContextFile, contextFileCapability } from "../capability/context-file"; -import { type ExtensionModule, extensionModuleCapability } from "../capability/extension-module"; -import { readFile } from "../capability/fs"; -import { type Hook, hookCapability } from "../capability/hook"; -import { registerProvider } from "../capability/index"; -import { type MCPServer, mcpCapability } from "../capability/mcp"; -import { type Settings, settingsCapability } from "../capability/settings"; -import { type Skill, skillCapability } from "../capability/skill"; -import { type SlashCommand, slashCommandCapability } from "../capability/slash-command"; -import { type SystemPrompt, systemPromptCapability } from "../capability/system-prompt"; -import { type CustomTool, toolCapability } from "../capability/tool"; -import type { LoadContext, LoadResult } from "../capability/types"; +import { type ContextFile, contextFileCapability } from "$c/capability/context-file"; +import { type ExtensionModule, extensionModuleCapability } from "$c/capability/extension-module"; +import { readFile } from "$c/capability/fs"; +import { type Hook, hookCapability } from "$c/capability/hook"; +import { registerProvider } from "$c/capability/index"; +import { type MCPServer, mcpCapability } from "$c/capability/mcp"; +import { type Settings, settingsCapability } from "$c/capability/settings"; +import { type Skill, skillCapability } from "$c/capability/skill"; +import { type SlashCommand, slashCommandCapability } from "$c/capability/slash-command"; +import { type SystemPrompt, systemPromptCapability } from "$c/capability/system-prompt"; +import { type CustomTool, toolCapability } from "$c/capability/tool"; +import type { LoadContext, LoadResult } from "$c/capability/types"; import { calculateDepth, createSourceMeta, diff --git a/packages/coding-agent/src/discovery/cline.ts b/packages/coding-agent/src/discovery/cline.ts index 4d85443c6..5df3e641d 100644 --- a/packages/coding-agent/src/discovery/cline.ts +++ b/packages/coding-agent/src/discovery/cline.ts @@ -6,12 +6,12 @@ */ import { dirname, resolve } from "node:path"; -import { readDirEntries, readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import type { Rule } from "../capability/rule"; -import { ruleCapability } from "../capability/rule"; -import type { LoadContext, LoadResult } from "../capability/types"; -import { parseFrontmatter } from "../core/frontmatter"; +import { readDirEntries, readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import type { Rule } from "$c/capability/rule"; +import { ruleCapability } from "$c/capability/rule"; +import type { LoadContext, LoadResult } from "$c/capability/types"; +import { parseFrontmatter } from "$c/core/frontmatter"; import { createSourceMeta, loadFilesFromDir } from "./helpers"; const PROVIDER_ID = "cline"; diff --git a/packages/coding-agent/src/discovery/codex.ts b/packages/coding-agent/src/discovery/codex.ts index e9fe6fcca..4b5fb4c0e 100644 --- a/packages/coding-agent/src/discovery/codex.ts +++ b/packages/coding-agent/src/discovery/codex.ts @@ -10,27 +10,27 @@ import { join } from "node:path"; import { logger } from "@oh-my-pi/pi-utils"; import { parse as parseToml } from "smol-toml"; -import type { ContextFile } from "../capability/context-file"; -import { contextFileCapability } from "../capability/context-file"; -import { type ExtensionModule, extensionModuleCapability } from "../capability/extension-module"; -import { readFile } from "../capability/fs"; -import type { Hook } from "../capability/hook"; -import { hookCapability } from "../capability/hook"; -import { registerProvider } from "../capability/index"; -import type { MCPServer } from "../capability/mcp"; -import { mcpCapability } from "../capability/mcp"; -import type { Prompt } from "../capability/prompt"; -import { promptCapability } from "../capability/prompt"; -import type { Settings } from "../capability/settings"; -import { settingsCapability } from "../capability/settings"; -import type { Skill } from "../capability/skill"; -import { skillCapability } from "../capability/skill"; -import type { SlashCommand } from "../capability/slash-command"; -import { slashCommandCapability } from "../capability/slash-command"; -import type { CustomTool } from "../capability/tool"; -import { toolCapability } from "../capability/tool"; -import type { LoadContext, LoadResult } from "../capability/types"; -import { parseFrontmatter } from "../core/frontmatter"; +import type { ContextFile } from "$c/capability/context-file"; +import { contextFileCapability } from "$c/capability/context-file"; +import { type ExtensionModule, extensionModuleCapability } from "$c/capability/extension-module"; +import { readFile } from "$c/capability/fs"; +import type { Hook } from "$c/capability/hook"; +import { hookCapability } from "$c/capability/hook"; +import { registerProvider } from "$c/capability/index"; +import type { MCPServer } from "$c/capability/mcp"; +import { mcpCapability } from "$c/capability/mcp"; +import type { Prompt } from "$c/capability/prompt"; +import { promptCapability } from "$c/capability/prompt"; +import type { Settings } from "$c/capability/settings"; +import { settingsCapability } from "$c/capability/settings"; +import type { Skill } from "$c/capability/skill"; +import { skillCapability } from "$c/capability/skill"; +import type { SlashCommand } from "$c/capability/slash-command"; +import { slashCommandCapability } from "$c/capability/slash-command"; +import type { CustomTool } from "$c/capability/tool"; +import { toolCapability } from "$c/capability/tool"; +import type { LoadContext, LoadResult } from "$c/capability/types"; +import { parseFrontmatter } from "$c/core/frontmatter"; import { createSourceMeta, discoverExtensionModulePaths, diff --git a/packages/coding-agent/src/discovery/cursor.ts b/packages/coding-agent/src/discovery/cursor.ts index 4075d9cfb..202b37430 100644 --- a/packages/coding-agent/src/discovery/cursor.ts +++ b/packages/coding-agent/src/discovery/cursor.ts @@ -14,15 +14,15 @@ * - settings: From settings.json if present */ -import { readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import { type MCPServer, mcpCapability } from "../capability/mcp"; -import type { Rule } from "../capability/rule"; -import { ruleCapability } from "../capability/rule"; -import type { Settings } from "../capability/settings"; -import { settingsCapability } from "../capability/settings"; -import type { LoadContext, LoadResult } from "../capability/types"; -import { parseFrontmatter } from "../core/frontmatter"; +import { readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import { type MCPServer, mcpCapability } from "$c/capability/mcp"; +import type { Rule } from "$c/capability/rule"; +import { ruleCapability } from "$c/capability/rule"; +import type { Settings } from "$c/capability/settings"; +import { settingsCapability } from "$c/capability/settings"; +import type { LoadContext, LoadResult } from "$c/capability/types"; +import { parseFrontmatter } from "$c/core/frontmatter"; import { createSourceMeta, expandEnvVarsDeep, diff --git a/packages/coding-agent/src/discovery/gemini.ts b/packages/coding-agent/src/discovery/gemini.ts index f3db769c1..7db3c55fe 100644 --- a/packages/coding-agent/src/discovery/gemini.ts +++ b/packages/coding-agent/src/discovery/gemini.ts @@ -17,15 +17,15 @@ */ import { join, sep } from "node:path"; -import { type ContextFile, contextFileCapability } from "../capability/context-file"; -import { type Extension, type ExtensionManifest, extensionCapability } from "../capability/extension"; -import { type ExtensionModule, extensionModuleCapability } from "../capability/extension-module"; -import { readDirEntries, readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import { type MCPServer, mcpCapability } from "../capability/mcp"; -import { type Settings, settingsCapability } from "../capability/settings"; -import { type SystemPrompt, systemPromptCapability } from "../capability/system-prompt"; -import type { LoadContext, LoadResult } from "../capability/types"; +import { type ContextFile, contextFileCapability } from "$c/capability/context-file"; +import { type Extension, type ExtensionManifest, extensionCapability } from "$c/capability/extension"; +import { type ExtensionModule, extensionModuleCapability } from "$c/capability/extension-module"; +import { readDirEntries, readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import { type MCPServer, mcpCapability } from "$c/capability/mcp"; +import { type Settings, settingsCapability } from "$c/capability/settings"; +import { type SystemPrompt, systemPromptCapability } from "$c/capability/system-prompt"; +import type { LoadContext, LoadResult } from "$c/capability/types"; import { calculateDepth, createSourceMeta, diff --git a/packages/coding-agent/src/discovery/github.ts b/packages/coding-agent/src/discovery/github.ts index f72eaab2d..fe7823400 100644 --- a/packages/coding-agent/src/discovery/github.ts +++ b/packages/coding-agent/src/discovery/github.ts @@ -13,12 +13,12 @@ */ import { basename, dirname, sep } from "node:path"; -import { type ContextFile, contextFileCapability } from "../capability/context-file"; -import { readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import { type Instruction, instructionCapability } from "../capability/instruction"; -import type { LoadContext, LoadResult, SourceMeta } from "../capability/types"; -import { parseFrontmatter } from "../core/frontmatter"; +import { type ContextFile, contextFileCapability } from "$c/capability/context-file"; +import { readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import { type Instruction, instructionCapability } from "$c/capability/instruction"; +import type { LoadContext, LoadResult, SourceMeta } from "$c/capability/types"; +import { parseFrontmatter } from "$c/core/frontmatter"; import { calculateDepth, createSourceMeta, getProjectPath, loadFilesFromDir } from "./helpers"; const PROVIDER_ID = "github"; diff --git a/packages/coding-agent/src/discovery/helpers.ts b/packages/coding-agent/src/discovery/helpers.ts index 2ba92b760..6915ad6e8 100644 --- a/packages/coding-agent/src/discovery/helpers.ts +++ b/packages/coding-agent/src/discovery/helpers.ts @@ -5,10 +5,10 @@ import { homedir } from "node:os"; import { join, resolve } from "node:path"; import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core"; -import { readDirEntries, readFile } from "../capability/fs"; -import type { Skill, SkillFrontmatter } from "../capability/skill"; -import type { LoadContext, LoadResult, SourceMeta } from "../capability/types"; -import { parseFrontmatter } from "../core/frontmatter"; +import { readDirEntries, readFile } from "$c/capability/fs"; +import type { Skill, SkillFrontmatter } from "$c/capability/skill"; +import type { LoadContext, LoadResult, SourceMeta } from "$c/capability/types"; +import { parseFrontmatter } from "$c/core/frontmatter"; const VALID_THINKING_LEVELS: readonly string[] = ["off", "minimal", "low", "medium", "high", "xhigh"]; const UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g; diff --git a/packages/coding-agent/src/discovery/index.ts b/packages/coding-agent/src/discovery/index.ts index db686624e..aa421ed3e 100644 --- a/packages/coding-agent/src/discovery/index.ts +++ b/packages/coding-agent/src/discovery/index.ts @@ -35,10 +35,10 @@ import "./agents-md"; import "./mcp-json"; import "./ssh"; -export type { ContextFile } from "../capability/context-file"; -export type { Extension, ExtensionManifest } from "../capability/extension"; -export type { ExtensionModule } from "../capability/extension-module"; -export type { Hook } from "../capability/hook"; +export type { ContextFile } from "$c/capability/context-file"; +export type { Extension, ExtensionManifest } from "$c/capability/extension"; +export type { ExtensionModule } from "$c/capability/extension-module"; +export type { Hook } from "$c/capability/hook"; // Re-export the main API from capability registry export { cacheStats, @@ -62,18 +62,18 @@ export { // Cache management reset, setDisabledProviders, -} from "../capability/index"; -export type { Instruction } from "../capability/instruction"; +} from "$c/capability/index"; +export type { Instruction } from "$c/capability/instruction"; // Re-export capability item types -export type { MCPServer } from "../capability/mcp"; -export type { Prompt } from "../capability/prompt"; -export type { Rule, RuleFrontmatter } from "../capability/rule"; -export type { Settings } from "../capability/settings"; -export type { Skill, SkillFrontmatter } from "../capability/skill"; -export type { SlashCommand } from "../capability/slash-command"; -export type { SSHHost } from "../capability/ssh"; -export type { SystemPrompt } from "../capability/system-prompt"; -export type { CustomTool } from "../capability/tool"; +export type { MCPServer } from "$c/capability/mcp"; +export type { Prompt } from "$c/capability/prompt"; +export type { Rule, RuleFrontmatter } from "$c/capability/rule"; +export type { Settings } from "$c/capability/settings"; +export type { Skill, SkillFrontmatter } from "$c/capability/skill"; +export type { SlashCommand } from "$c/capability/slash-command"; +export type { SSHHost } from "$c/capability/ssh"; +export type { SystemPrompt } from "$c/capability/system-prompt"; +export type { CustomTool } from "$c/capability/tool"; // Re-export types export type { Capability, @@ -85,4 +85,4 @@ export type { Provider, ProviderInfo, SourceMeta, -} from "../capability/types"; +} from "$c/capability/types"; diff --git a/packages/coding-agent/src/discovery/mcp-json.ts b/packages/coding-agent/src/discovery/mcp-json.ts index 7dc3d24c0..396c21d3e 100644 --- a/packages/coding-agent/src/discovery/mcp-json.ts +++ b/packages/coding-agent/src/discovery/mcp-json.ts @@ -8,10 +8,10 @@ */ import { join } from "node:path"; -import { readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import { type MCPServer, mcpCapability } from "../capability/mcp"; -import type { LoadContext, LoadResult, SourceMeta } from "../capability/types"; +import { readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import { type MCPServer, mcpCapability } from "$c/capability/mcp"; +import type { LoadContext, LoadResult, SourceMeta } from "$c/capability/types"; import { createSourceMeta, expandEnvVarsDeep, parseJSON } from "./helpers"; const PROVIDER_ID = "mcp-json"; diff --git a/packages/coding-agent/src/discovery/ssh.ts b/packages/coding-agent/src/discovery/ssh.ts index 4e5ac16ee..fd53fb61c 100644 --- a/packages/coding-agent/src/discovery/ssh.ts +++ b/packages/coding-agent/src/discovery/ssh.ts @@ -6,10 +6,10 @@ */ import { join } from "node:path"; -import { readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import { type SSHHost, sshCapability } from "../capability/ssh"; -import type { LoadContext, LoadResult, SourceMeta } from "../capability/types"; +import { readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import { type SSHHost, sshCapability } from "$c/capability/ssh"; +import type { LoadContext, LoadResult, SourceMeta } from "$c/capability/types"; import { createSourceMeta, expandEnvVarsDeep, parseJSON } from "./helpers"; const PROVIDER_ID = "ssh-json"; diff --git a/packages/coding-agent/src/discovery/vscode.ts b/packages/coding-agent/src/discovery/vscode.ts index e494d954c..44b350a92 100644 --- a/packages/coding-agent/src/discovery/vscode.ts +++ b/packages/coding-agent/src/discovery/vscode.ts @@ -5,10 +5,10 @@ * Supports MCP server discovery from `mcp.json` with nested `mcp.servers` structure. */ -import { readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import { type MCPServer, mcpCapability } from "../capability/mcp"; -import type { LoadContext, LoadResult } from "../capability/types"; +import { readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import { type MCPServer, mcpCapability } from "$c/capability/mcp"; +import type { LoadContext, LoadResult } from "$c/capability/types"; import { createSourceMeta, expandEnvVarsDeep, getProjectPath, parseJSON } from "./helpers"; const PROVIDER_ID = "vscode"; diff --git a/packages/coding-agent/src/discovery/windsurf.ts b/packages/coding-agent/src/discovery/windsurf.ts index e4032574e..5b7db28ba 100644 --- a/packages/coding-agent/src/discovery/windsurf.ts +++ b/packages/coding-agent/src/discovery/windsurf.ts @@ -11,12 +11,12 @@ * - Legacy .windsurfrules file */ -import { readFile } from "../capability/fs"; -import { registerProvider } from "../capability/index"; -import { type MCPServer, mcpCapability } from "../capability/mcp"; -import { type Rule, ruleCapability } from "../capability/rule"; -import type { LoadContext, LoadResult } from "../capability/types"; -import { parseFrontmatter } from "../core/frontmatter"; +import { readFile } from "$c/capability/fs"; +import { registerProvider } from "$c/capability/index"; +import { type MCPServer, mcpCapability } from "$c/capability/mcp"; +import { type Rule, ruleCapability } from "$c/capability/rule"; +import type { LoadContext, LoadResult } from "$c/capability/types"; +import { parseFrontmatter } from "$c/core/frontmatter"; import { createSourceMeta, expandEnvVarsDeep, diff --git a/packages/coding-agent/src/modes/interactive/components/armin.ts b/packages/coding-agent/src/modes/interactive/components/armin.ts index c1b22a759..fcfa8ac2a 100644 --- a/packages/coding-agent/src/modes/interactive/components/armin.ts +++ b/packages/coding-agent/src/modes/interactive/components/armin.ts @@ -3,7 +3,7 @@ */ import type { Component, TUI } from "@oh-my-pi/pi-tui"; -import { theme } from "../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; // XBM image: 31x36 pixels, LSB first, 1=background, 0=foreground const WIDTH = 31; diff --git a/packages/coding-agent/src/modes/interactive/components/assistant-message.ts b/packages/coding-agent/src/modes/interactive/components/assistant-message.ts index 61b75214e..591cc9edb 100644 --- a/packages/coding-agent/src/modes/interactive/components/assistant-message.ts +++ b/packages/coding-agent/src/modes/interactive/components/assistant-message.ts @@ -1,6 +1,6 @@ import type { AssistantMessage } from "@oh-my-pi/pi-ai"; import { Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui"; -import { getMarkdownTheme, theme } from "../theme/theme"; +import { getMarkdownTheme, theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a complete assistant message diff --git a/packages/coding-agent/src/modes/interactive/components/bash-execution.ts b/packages/coding-agent/src/modes/interactive/components/bash-execution.ts index b76ab8d95..9043227f5 100644 --- a/packages/coding-agent/src/modes/interactive/components/bash-execution.ts +++ b/packages/coding-agent/src/modes/interactive/components/bash-execution.ts @@ -4,9 +4,9 @@ import { Container, Loader, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui"; import stripAnsi from "strip-ansi"; -import type { TruncationMeta } from "../../../core/output-meta"; -import { formatSize } from "../../../core/tools/truncate"; -import { getSymbolTheme, theme } from "../theme/theme"; +import type { TruncationMeta } from "$c/core/output-meta"; +import { formatSize } from "$c/core/tools/truncate"; +import { getSymbolTheme, theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; import { truncateToVisualLines } from "./visual-truncate"; diff --git a/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts b/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts index 3eb69c09d..6f8552820 100644 --- a/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts +++ b/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts @@ -1,5 +1,5 @@ import { CancellableLoader, Container, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui"; -import type { Theme } from "../theme/theme"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; /** Loader wrapped with borders for hook UI */ diff --git a/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts b/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts index 50342024c..21cd69d6e 100644 --- a/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts +++ b/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts @@ -1,6 +1,6 @@ import { Box, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui"; -import type { BranchSummaryMessage } from "../../../core/messages"; -import { getMarkdownTheme, theme } from "../theme/theme"; +import type { BranchSummaryMessage } from "$c/core/messages"; +import { getMarkdownTheme, theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a branch summary message with collapsed/expanded state. diff --git a/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts b/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts index a19e69f49..17b1dca28 100644 --- a/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts +++ b/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts @@ -1,6 +1,6 @@ import { Box, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui"; -import type { CompactionSummaryMessage } from "../../../core/messages"; -import { getMarkdownTheme, theme } from "../theme/theme"; +import type { CompactionSummaryMessage } from "$c/core/messages"; +import { getMarkdownTheme, theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a compaction message with collapsed/expanded state. diff --git a/packages/coding-agent/src/modes/interactive/components/custom-message.ts b/packages/coding-agent/src/modes/interactive/components/custom-message.ts index 494f23671..f38e0ec8b 100644 --- a/packages/coding-agent/src/modes/interactive/components/custom-message.ts +++ b/packages/coding-agent/src/modes/interactive/components/custom-message.ts @@ -1,9 +1,9 @@ import type { TextContent } from "@oh-my-pi/pi-ai"; import type { Component } from "@oh-my-pi/pi-tui"; import { Box, Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui"; -import type { MessageRenderer } from "../../../core/extensions/types"; -import type { CustomMessage } from "../../../core/messages"; -import { getMarkdownTheme, theme } from "../theme/theme"; +import type { MessageRenderer } from "$c/core/extensions/types"; +import type { CustomMessage } from "$c/core/messages"; +import { getMarkdownTheme, theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a custom message entry from extensions. diff --git a/packages/coding-agent/src/modes/interactive/components/diff.ts b/packages/coding-agent/src/modes/interactive/components/diff.ts index 507c0d9d0..678de74aa 100644 --- a/packages/coding-agent/src/modes/interactive/components/diff.ts +++ b/packages/coding-agent/src/modes/interactive/components/diff.ts @@ -1,5 +1,5 @@ import * as Diff from "diff"; -import { theme } from "../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; /** * Parse diff line to extract prefix, line number, and content. diff --git a/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts b/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts index 6fe1bd98d..b5e8d56dc 100644 --- a/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts +++ b/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts @@ -1,5 +1,5 @@ import type { Component } from "@oh-my-pi/pi-tui"; -import { theme } from "../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; /** * Dynamic border component that adjusts to viewport width. diff --git a/packages/coding-agent/src/modes/interactive/components/extensions/extension-dashboard.ts b/packages/coding-agent/src/modes/interactive/components/extensions/extension-dashboard.ts index b6a72f587..57a609aba 100644 --- a/packages/coding-agent/src/modes/interactive/components/extensions/extension-dashboard.ts +++ b/packages/coding-agent/src/modes/interactive/components/extensions/extension-dashboard.ts @@ -13,9 +13,9 @@ */ import { type Component, Container, matchesKey, Spacer, Text, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui"; -import type { SettingsManager } from "../../../../core/settings-manager"; -import { theme } from "../../theme/theme"; -import { DynamicBorder } from "../dynamic-border"; +import type { SettingsManager } from "$c/core/settings-manager"; +import { DynamicBorder } from "$c/modes/interactive/components/dynamic-border"; +import { theme } from "$c/modes/interactive/theme/theme"; import { ExtensionList } from "./extension-list"; import { InspectorPanel } from "./inspector-panel"; import { applyFilter, createInitialState, filterByProvider, refreshState, toggleProvider } from "./state-manager"; diff --git a/packages/coding-agent/src/modes/interactive/components/extensions/extension-list.ts b/packages/coding-agent/src/modes/interactive/components/extensions/extension-list.ts index 95afba23f..b2141ba09 100644 --- a/packages/coding-agent/src/modes/interactive/components/extensions/extension-list.ts +++ b/packages/coding-agent/src/modes/interactive/components/extensions/extension-list.ts @@ -7,8 +7,8 @@ */ import { type Component, matchesKey, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui"; -import { isProviderEnabled } from "../../../../discovery"; -import { theme } from "../../theme/theme"; +import { isProviderEnabled } from "$c/discovery"; +import { theme } from "$c/modes/interactive/theme/theme"; import { applyFilter } from "./state-manager"; import type { Extension, ExtensionKind, ExtensionState } from "./types"; diff --git a/packages/coding-agent/src/modes/interactive/components/extensions/inspector-panel.ts b/packages/coding-agent/src/modes/interactive/components/extensions/inspector-panel.ts index 5d9d9a19e..9ee177011 100644 --- a/packages/coding-agent/src/modes/interactive/components/extensions/inspector-panel.ts +++ b/packages/coding-agent/src/modes/interactive/components/extensions/inspector-panel.ts @@ -6,7 +6,7 @@ import { homedir } from "node:os"; import { type Component, truncateToWidth, wrapTextWithAnsi } from "@oh-my-pi/pi-tui"; -import { theme } from "../../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; import type { Extension, ExtensionState } from "./types"; export class InspectorPanel implements Component { diff --git a/packages/coding-agent/src/modes/interactive/components/extensions/state-manager.ts b/packages/coding-agent/src/modes/interactive/components/extensions/state-manager.ts index 99ea1557f..5151778f8 100644 --- a/packages/coding-agent/src/modes/interactive/components/extensions/state-manager.ts +++ b/packages/coding-agent/src/modes/interactive/components/extensions/state-manager.ts @@ -4,23 +4,17 @@ */ import { logger } from "@oh-my-pi/pi-utils"; -import type { ContextFile } from "../../../../capability/context-file"; -import type { ExtensionModule } from "../../../../capability/extension-module"; -import type { Hook } from "../../../../capability/hook"; -import type { MCPServer } from "../../../../capability/mcp"; -import type { Prompt } from "../../../../capability/prompt"; -import type { Rule } from "../../../../capability/rule"; -import type { Skill } from "../../../../capability/skill"; -import type { SlashCommand } from "../../../../capability/slash-command"; -import type { CustomTool } from "../../../../capability/tool"; -import type { SourceMeta } from "../../../../capability/types"; -import { - disableProvider, - enableProvider, - getAllProvidersInfo, - isProviderEnabled, - loadCapability, -} from "../../../../discovery"; +import type { ContextFile } from "$c/capability/context-file"; +import type { ExtensionModule } from "$c/capability/extension-module"; +import type { Hook } from "$c/capability/hook"; +import type { MCPServer } from "$c/capability/mcp"; +import type { Prompt } from "$c/capability/prompt"; +import type { Rule } from "$c/capability/rule"; +import type { Skill } from "$c/capability/skill"; +import type { SlashCommand } from "$c/capability/slash-command"; +import type { CustomTool } from "$c/capability/tool"; +import type { SourceMeta } from "$c/capability/types"; +import { disableProvider, enableProvider, getAllProvidersInfo, isProviderEnabled, loadCapability } from "$c/discovery"; import type { DashboardState, Extension, diff --git a/packages/coding-agent/src/modes/interactive/components/extensions/types.ts b/packages/coding-agent/src/modes/interactive/components/extensions/types.ts index 04285c79e..8ae64fdf1 100644 --- a/packages/coding-agent/src/modes/interactive/components/extensions/types.ts +++ b/packages/coding-agent/src/modes/interactive/components/extensions/types.ts @@ -2,7 +2,7 @@ * Types for the Extension Control Center dashboard. */ -import type { SourceMeta } from "../../../../capability/types"; +import type { SourceMeta } from "$c/capability/types"; /** * Extension kinds matching capability types. diff --git a/packages/coding-agent/src/modes/interactive/components/footer.ts b/packages/coding-agent/src/modes/interactive/components/footer.ts index 2b30a2612..478b5adab 100644 --- a/packages/coding-agent/src/modes/interactive/components/footer.ts +++ b/packages/coding-agent/src/modes/interactive/components/footer.ts @@ -2,9 +2,9 @@ import { existsSync, type FSWatcher, readFileSync, watch } from "node:fs"; import type { AssistantMessage } from "@oh-my-pi/pi-ai"; import { type Component, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui"; import { dirname, join } from "path"; -import type { AgentSession } from "../../../core/agent-session"; -import { shortenPath } from "../../../core/tools/render-utils"; -import { theme } from "../theme/theme"; +import type { AgentSession } from "$c/core/agent-session"; +import { shortenPath } from "$c/core/tools/render-utils"; +import { theme } from "$c/modes/interactive/theme/theme"; /** * Sanitize text for display in a single-line status. diff --git a/packages/coding-agent/src/modes/interactive/components/history-search.ts b/packages/coding-agent/src/modes/interactive/components/history-search.ts index c16b5df8e..5e0042158 100644 --- a/packages/coding-agent/src/modes/interactive/components/history-search.ts +++ b/packages/coding-agent/src/modes/interactive/components/history-search.ts @@ -8,8 +8,8 @@ import { truncateToWidth, visibleWidth, } from "@oh-my-pi/pi-tui"; -import type { HistoryEntry, HistoryStorage } from "../../../core/history-storage"; -import { theme } from "../theme/theme"; +import type { HistoryEntry, HistoryStorage } from "$c/core/history-storage"; +import { theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; class HistoryResultsList implements Component { diff --git a/packages/coding-agent/src/modes/interactive/components/hook-editor.ts b/packages/coding-agent/src/modes/interactive/components/hook-editor.ts index 21059ff11..99ef3ab28 100644 --- a/packages/coding-agent/src/modes/interactive/components/hook-editor.ts +++ b/packages/coding-agent/src/modes/interactive/components/hook-editor.ts @@ -8,7 +8,7 @@ import * as os from "node:os"; import * as path from "node:path"; import { Container, Editor, matchesKey, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui"; import { nanoid } from "nanoid"; -import { getEditorTheme, theme } from "../theme/theme"; +import { getEditorTheme, theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; export class HookEditorComponent extends Container { diff --git a/packages/coding-agent/src/modes/interactive/components/hook-input.ts b/packages/coding-agent/src/modes/interactive/components/hook-input.ts index 8126dd941..0981c7f67 100644 --- a/packages/coding-agent/src/modes/interactive/components/hook-input.ts +++ b/packages/coding-agent/src/modes/interactive/components/hook-input.ts @@ -3,7 +3,7 @@ */ import { Container, Input, matchesKey, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui"; -import { theme } from "../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; import { CountdownTimer } from "./countdown-timer"; import { DynamicBorder } from "./dynamic-border"; diff --git a/packages/coding-agent/src/modes/interactive/components/hook-message.ts b/packages/coding-agent/src/modes/interactive/components/hook-message.ts index 837083859..026fb0403 100644 --- a/packages/coding-agent/src/modes/interactive/components/hook-message.ts +++ b/packages/coding-agent/src/modes/interactive/components/hook-message.ts @@ -1,9 +1,9 @@ import type { TextContent } from "@oh-my-pi/pi-ai"; import type { Component } from "@oh-my-pi/pi-tui"; import { Box, Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui"; -import type { HookMessageRenderer } from "../../../core/hooks/types"; -import type { HookMessage } from "../../../core/messages"; -import { getMarkdownTheme, theme } from "../theme/theme"; +import type { HookMessageRenderer } from "$c/core/hooks/types"; +import type { HookMessage } from "$c/core/messages"; +import { getMarkdownTheme, theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a custom message entry from hooks. diff --git a/packages/coding-agent/src/modes/interactive/components/hook-selector.ts b/packages/coding-agent/src/modes/interactive/components/hook-selector.ts index ee3f52d51..049cb8347 100644 --- a/packages/coding-agent/src/modes/interactive/components/hook-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/hook-selector.ts @@ -4,7 +4,7 @@ */ import { Container, matchesKey, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui"; -import { theme } from "../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; import { CountdownTimer } from "./countdown-timer"; import { DynamicBorder } from "./dynamic-border"; diff --git a/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts b/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts index 3fdfdfc67..c1fd7e964 100644 --- a/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts +++ b/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts @@ -3,8 +3,8 @@ */ import { type EditorAction, getEditorKeybindings, type KeyId } from "@oh-my-pi/pi-tui"; -import type { AppAction, KeybindingsManager } from "../../../core/keybindings"; -import { theme } from "../theme/theme"; +import type { AppAction, KeybindingsManager } from "$c/core/keybindings"; +import { theme } from "$c/modes/interactive/theme/theme"; /** * Format keys array as display string (e.g., ["ctrl+c", "escape"] -> "ctrl+c/escape"). diff --git a/packages/coding-agent/src/modes/interactive/components/login-dialog.ts b/packages/coding-agent/src/modes/interactive/components/login-dialog.ts index 11fd886e0..e2ee64455 100644 --- a/packages/coding-agent/src/modes/interactive/components/login-dialog.ts +++ b/packages/coding-agent/src/modes/interactive/components/login-dialog.ts @@ -1,7 +1,7 @@ import { getOAuthProviders } from "@oh-my-pi/pi-ai"; import { Container, getEditorKeybindings, Input, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui"; import { $ } from "bun"; -import { theme } from "../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; /** diff --git a/packages/coding-agent/src/modes/interactive/components/model-selector.ts b/packages/coding-agent/src/modes/interactive/components/model-selector.ts index d60728fcb..92520d70f 100644 --- a/packages/coding-agent/src/modes/interactive/components/model-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/model-selector.ts @@ -11,11 +11,11 @@ import { type TUI, visibleWidth, } from "@oh-my-pi/pi-tui"; -import type { ModelRegistry } from "../../../core/model-registry"; -import { parseModelString } from "../../../core/model-resolver"; -import type { SettingsManager } from "../../../core/settings-manager"; -import { fuzzyFilter } from "../../../utils/fuzzy"; -import { type ThemeColor, theme } from "../theme/theme"; +import type { ModelRegistry } from "$c/core/model-registry"; +import { parseModelString } from "$c/core/model-resolver"; +import type { SettingsManager } from "$c/core/settings-manager"; +import { type ThemeColor, theme } from "$c/modes/interactive/theme/theme"; +import { fuzzyFilter } from "$c/utils/fuzzy"; import { DynamicBorder } from "./dynamic-border"; function makeInvertedBadge(label: string, color: ThemeColor): string { diff --git a/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts b/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts index d7033a687..8859e4fe4 100644 --- a/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts @@ -1,7 +1,7 @@ import { getOAuthProviders, type OAuthProviderInfo } from "@oh-my-pi/pi-ai"; import { Container, matchesKey, Spacer, TruncatedText } from "@oh-my-pi/pi-tui"; -import type { AuthStorage } from "../../../core/auth-storage"; -import { theme } from "../theme/theme"; +import type { AuthStorage } from "$c/core/auth-storage"; +import { theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; /** diff --git a/packages/coding-agent/src/modes/interactive/components/plugin-settings.ts b/packages/coding-agent/src/modes/interactive/components/plugin-settings.ts index f0f5d62c6..400cf5be2 100644 --- a/packages/coding-agent/src/modes/interactive/components/plugin-settings.ts +++ b/packages/coding-agent/src/modes/interactive/components/plugin-settings.ts @@ -18,9 +18,9 @@ import { Spacer, Text, } from "@oh-my-pi/pi-tui"; -import { PluginManager } from "../../../core/plugins/manager"; -import type { InstalledPlugin, PluginSettingSchema } from "../../../core/plugins/types"; -import { getSelectListTheme, getSettingsListTheme, theme } from "../theme/theme"; +import { PluginManager } from "$c/core/plugins/manager"; +import type { InstalledPlugin, PluginSettingSchema } from "$c/core/plugins/types"; +import { getSelectListTheme, getSettingsListTheme, theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; // ============================================================================= diff --git a/packages/coding-agent/src/modes/interactive/components/python-execution.ts b/packages/coding-agent/src/modes/interactive/components/python-execution.ts index 4cea2faa2..2384114d4 100644 --- a/packages/coding-agent/src/modes/interactive/components/python-execution.ts +++ b/packages/coding-agent/src/modes/interactive/components/python-execution.ts @@ -5,9 +5,9 @@ import { Container, Loader, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui"; import stripAnsi from "strip-ansi"; -import type { TruncationMeta } from "../../../core/output-meta"; -import { formatSize } from "../../../core/tools/truncate"; -import { getSymbolTheme, highlightCode, theme } from "../theme/theme"; +import type { TruncationMeta } from "$c/core/output-meta"; +import { formatSize } from "$c/core/tools/truncate"; +import { getSymbolTheme, highlightCode, theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; import { truncateToVisualLines } from "./visual-truncate"; diff --git a/packages/coding-agent/src/modes/interactive/components/queue-mode-selector.ts b/packages/coding-agent/src/modes/interactive/components/queue-mode-selector.ts index 80721f7b3..6d2a10e2b 100644 --- a/packages/coding-agent/src/modes/interactive/components/queue-mode-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/queue-mode-selector.ts @@ -1,5 +1,5 @@ import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui"; -import { getSelectListTheme } from "../theme/theme"; +import { getSelectListTheme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; /** diff --git a/packages/coding-agent/src/modes/interactive/components/read-tool-group.ts b/packages/coding-agent/src/modes/interactive/components/read-tool-group.ts index bdfe449f9..1daf007ae 100644 --- a/packages/coding-agent/src/modes/interactive/components/read-tool-group.ts +++ b/packages/coding-agent/src/modes/interactive/components/read-tool-group.ts @@ -1,7 +1,7 @@ import type { Component } from "@oh-my-pi/pi-tui"; import { Container, Text } from "@oh-my-pi/pi-tui"; -import { shortenPath } from "../../../core/tools/render-utils"; -import { theme } from "../theme/theme"; +import { shortenPath } from "$c/core/tools/render-utils"; +import { theme } from "$c/modes/interactive/theme/theme"; import type { ToolExecutionHandle } from "./tool-execution"; type ReadRenderArgs = { diff --git a/packages/coding-agent/src/modes/interactive/components/session-selector.ts b/packages/coding-agent/src/modes/interactive/components/session-selector.ts index 2de6eabcb..52fe0ba09 100644 --- a/packages/coding-agent/src/modes/interactive/components/session-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/session-selector.ts @@ -8,9 +8,9 @@ import { truncateToWidth, visibleWidth, } from "@oh-my-pi/pi-tui"; -import type { SessionInfo } from "../../../core/session-manager"; -import { fuzzyFilter } from "../../../utils/fuzzy"; -import { theme } from "../theme/theme"; +import type { SessionInfo } from "$c/core/session-manager"; +import { theme } from "$c/modes/interactive/theme/theme"; +import { fuzzyFilter } from "$c/utils/fuzzy"; import { DynamicBorder } from "./dynamic-border"; /** diff --git a/packages/coding-agent/src/modes/interactive/components/settings-defs.ts b/packages/coding-agent/src/modes/interactive/components/settings-defs.ts index c8c32008c..e302ff144 100644 --- a/packages/coding-agent/src/modes/interactive/components/settings-defs.ts +++ b/packages/coding-agent/src/modes/interactive/components/settings-defs.ts @@ -20,7 +20,7 @@ import type { StatusLineSeparatorStyle, SymbolPreset, WebSearchProviderOption, -} from "../../../core/settings-manager"; +} from "$c/core/settings-manager"; import { getPreset } from "./status-line/presets"; // Setting value types diff --git a/packages/coding-agent/src/modes/interactive/components/settings-selector.ts b/packages/coding-agent/src/modes/interactive/components/settings-selector.ts index 9ce08b340..aef2e1686 100644 --- a/packages/coding-agent/src/modes/interactive/components/settings-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/settings-selector.ts @@ -12,8 +12,8 @@ import { type TabBarTheme, Text, } from "@oh-my-pi/pi-tui"; -import type { SettingsManager, StatusLineSettings } from "../../../core/settings-manager"; -import { getSelectListTheme, getSettingsListTheme, theme } from "../theme/theme"; +import type { SettingsManager, StatusLineSettings } from "$c/core/settings-manager"; +import { getSelectListTheme, getSettingsListTheme, theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; import { PluginSettingsComponent } from "./plugin-settings"; import { getSettingsForTab, type SettingDef } from "./settings-defs"; diff --git a/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts b/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts index 9697b0d9a..6d67e585b 100644 --- a/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts @@ -1,5 +1,5 @@ import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui"; -import { getSelectListTheme } from "../theme/theme"; +import { getSelectListTheme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; /** diff --git a/packages/coding-agent/src/modes/interactive/components/status-line-segment-editor.ts b/packages/coding-agent/src/modes/interactive/components/status-line-segment-editor.ts index 511c4f541..50553ce4f 100644 --- a/packages/coding-agent/src/modes/interactive/components/status-line-segment-editor.ts +++ b/packages/coding-agent/src/modes/interactive/components/status-line-segment-editor.ts @@ -10,8 +10,8 @@ */ import { Container, matchesKey } from "@oh-my-pi/pi-tui"; -import type { StatusLineSegmentId } from "../../../core/settings-manager"; -import { theme } from "../theme/theme"; +import type { StatusLineSegmentId } from "$c/core/settings-manager"; +import { theme } from "$c/modes/interactive/theme/theme"; import { ALL_SEGMENT_IDS } from "./status-line/segments"; // Segment display names and short descriptions diff --git a/packages/coding-agent/src/modes/interactive/components/status-line.ts b/packages/coding-agent/src/modes/interactive/components/status-line.ts index f0671194d..46315b183 100644 --- a/packages/coding-agent/src/modes/interactive/components/status-line.ts +++ b/packages/coding-agent/src/modes/interactive/components/status-line.ts @@ -3,9 +3,9 @@ import { type Component, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui" import { $ } from "bun"; import { type FSWatcher, watch } from "fs"; import { dirname, join } from "path"; -import type { AgentSession } from "../../../core/agent-session"; -import type { StatusLineSegmentOptions, StatusLineSettings } from "../../../core/settings-manager"; -import { theme } from "../theme/theme"; +import type { AgentSession } from "$c/core/agent-session"; +import type { StatusLineSegmentOptions, StatusLineSettings } from "$c/core/settings-manager"; +import { theme } from "$c/modes/interactive/theme/theme"; import { getPreset } from "./status-line/presets"; import { renderSegment, type SegmentContext } from "./status-line/segments"; import { getSeparator } from "./status-line/separators"; diff --git a/packages/coding-agent/src/modes/interactive/components/status-line/segments.ts b/packages/coding-agent/src/modes/interactive/components/status-line/segments.ts index 7432e3d03..283d17732 100644 --- a/packages/coding-agent/src/modes/interactive/components/status-line/segments.ts +++ b/packages/coding-agent/src/modes/interactive/components/status-line/segments.ts @@ -1,6 +1,6 @@ import { hostname as osHostname } from "node:os"; -import { shortenPath } from "../../../../core/tools/render-utils"; -import { theme } from "../../theme/theme"; +import { shortenPath } from "$c/core/tools/render-utils"; +import { theme } from "$c/modes/interactive/theme/theme"; import type { RenderedSegment, SegmentContext, StatusLineSegment, StatusLineSegmentId } from "./types"; export type { SegmentContext } from "./types"; diff --git a/packages/coding-agent/src/modes/interactive/components/status-line/separators.ts b/packages/coding-agent/src/modes/interactive/components/status-line/separators.ts index 200f7f842..50e135c9c 100644 --- a/packages/coding-agent/src/modes/interactive/components/status-line/separators.ts +++ b/packages/coding-agent/src/modes/interactive/components/status-line/separators.ts @@ -1,4 +1,4 @@ -import type { Theme } from "../../theme/theme"; +import type { Theme } from "$c/modes/interactive/theme/theme"; import type { SeparatorDef, StatusLineSeparatorStyle } from "./types"; function trimSep(value: string): string { diff --git a/packages/coding-agent/src/modes/interactive/components/status-line/types.ts b/packages/coding-agent/src/modes/interactive/components/status-line/types.ts index 96e25818b..7b1c28989 100644 --- a/packages/coding-agent/src/modes/interactive/components/status-line/types.ts +++ b/packages/coding-agent/src/modes/interactive/components/status-line/types.ts @@ -1,11 +1,11 @@ -import type { AgentSession } from "../../../../core/agent-session"; +import type { AgentSession } from "$c/core/agent-session"; import type { StatusLinePreset, StatusLineSegmentId, StatusLineSegmentOptions, StatusLineSeparatorStyle, StatusLineSettings, -} from "../../../../core/settings-manager"; +} from "$c/core/settings-manager"; // Re-export types from settings-manager (single source of truth) export type { diff --git a/packages/coding-agent/src/modes/interactive/components/theme-selector.ts b/packages/coding-agent/src/modes/interactive/components/theme-selector.ts index 8491eb4eb..fa52e6c6c 100644 --- a/packages/coding-agent/src/modes/interactive/components/theme-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/theme-selector.ts @@ -1,5 +1,5 @@ import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui"; -import { getAvailableThemes, getSelectListTheme } from "../theme/theme"; +import { getAvailableThemes, getSelectListTheme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; /** diff --git a/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts b/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts index e40191e3c..c520cb1f8 100644 --- a/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts @@ -1,6 +1,6 @@ import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui"; -import { getSelectListTheme } from "../theme/theme"; +import { getSelectListTheme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; const LEVEL_DESCRIPTIONS: Record = { diff --git a/packages/coding-agent/src/modes/interactive/components/todo-display.ts b/packages/coding-agent/src/modes/interactive/components/todo-display.ts index 7f6e5df0b..493e94cd1 100644 --- a/packages/coding-agent/src/modes/interactive/components/todo-display.ts +++ b/packages/coding-agent/src/modes/interactive/components/todo-display.ts @@ -1,8 +1,8 @@ import * as path from "node:path"; import { Text } from "@oh-my-pi/pi-tui"; import { logger } from "@oh-my-pi/pi-utils"; -import { theme } from "../theme/theme"; -import type { TodoItem } from "../types"; +import { theme } from "$c/modes/interactive/theme/theme"; +import type { TodoItem } from "$c/modes/interactive/types"; const TODO_FILE_NAME = "todos.json"; diff --git a/packages/coding-agent/src/modes/interactive/components/todo-reminder.ts b/packages/coding-agent/src/modes/interactive/components/todo-reminder.ts index ef2fa4f99..7ae70b3f2 100644 --- a/packages/coding-agent/src/modes/interactive/components/todo-reminder.ts +++ b/packages/coding-agent/src/modes/interactive/components/todo-reminder.ts @@ -1,6 +1,6 @@ import { Box, Container, Spacer, Text } from "@oh-my-pi/pi-tui"; -import type { TodoItem } from "../../../core/tools/todo-write"; -import { theme } from "../theme/theme"; +import type { TodoItem } from "$c/core/tools/todo-write"; +import { theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a todo completion reminder notification. diff --git a/packages/coding-agent/src/modes/interactive/components/tool-execution.ts b/packages/coding-agent/src/modes/interactive/components/tool-execution.ts index 31750f8f4..5872f7dc6 100644 --- a/packages/coding-agent/src/modes/interactive/components/tool-execution.ts +++ b/packages/coding-agent/src/modes/interactive/components/tool-execution.ts @@ -11,12 +11,12 @@ import { type TUI, } from "@oh-my-pi/pi-tui"; import { sanitizeText } from "@oh-my-pi/pi-utils"; -import { BASH_DEFAULT_PREVIEW_LINES } from "../../../core/tools/bash"; -import { computeEditDiff, computePatchDiff, type EditDiffError, type EditDiffResult } from "../../../core/tools/patch"; -import { PYTHON_DEFAULT_PREVIEW_LINES } from "../../../core/tools/python"; -import { toolRenderers } from "../../../core/tools/renderers"; -import { convertToPng } from "../../../utils/image-convert"; -import { theme } from "../theme/theme"; +import { BASH_DEFAULT_PREVIEW_LINES } from "$c/core/tools/bash"; +import { computeEditDiff, computePatchDiff, type EditDiffError, type EditDiffResult } from "$c/core/tools/patch"; +import { PYTHON_DEFAULT_PREVIEW_LINES } from "$c/core/tools/python"; +import { toolRenderers } from "$c/core/tools/renderers"; +import { theme } from "$c/modes/interactive/theme/theme"; +import { convertToPng } from "$c/utils/image-convert"; import { renderDiff } from "./diff"; // Preview line limit for bash when not expanded diff --git a/packages/coding-agent/src/modes/interactive/components/tree-selector.ts b/packages/coding-agent/src/modes/interactive/components/tree-selector.ts index a5e0e88cc..c62c07461 100644 --- a/packages/coding-agent/src/modes/interactive/components/tree-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/tree-selector.ts @@ -8,9 +8,9 @@ import { TruncatedText, truncateToWidth, } from "@oh-my-pi/pi-tui"; -import type { SessionTreeNode } from "../../../core/session-manager"; -import { shortenPath } from "../../../core/tools/render-utils"; -import { theme } from "../theme/theme"; +import type { SessionTreeNode } from "$c/core/session-manager"; +import { shortenPath } from "$c/core/tools/render-utils"; +import { theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; /** Gutter info: position (displayIndent where connector was) and whether to show │ */ diff --git a/packages/coding-agent/src/modes/interactive/components/ttsr-notification.ts b/packages/coding-agent/src/modes/interactive/components/ttsr-notification.ts index c0127628c..2f7f078b7 100644 --- a/packages/coding-agent/src/modes/interactive/components/ttsr-notification.ts +++ b/packages/coding-agent/src/modes/interactive/components/ttsr-notification.ts @@ -1,6 +1,6 @@ import { Box, Container, Spacer, Text } from "@oh-my-pi/pi-tui"; -import type { Rule } from "../../../capability/rule"; -import { theme } from "../theme/theme"; +import type { Rule } from "$c/capability/rule"; +import { theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a TTSR (Time Traveling Stream Rules) notification. diff --git a/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts b/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts index 8b076b89c..b03e85dbb 100644 --- a/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts @@ -1,5 +1,5 @@ import { type Component, Container, matchesKey, Spacer, Text, truncateToWidth } from "@oh-my-pi/pi-tui"; -import { theme } from "../theme/theme"; +import { theme } from "$c/modes/interactive/theme/theme"; import { DynamicBorder } from "./dynamic-border"; interface UserMessageItem { diff --git a/packages/coding-agent/src/modes/interactive/components/user-message.ts b/packages/coding-agent/src/modes/interactive/components/user-message.ts index acd966b88..71c53d6bc 100644 --- a/packages/coding-agent/src/modes/interactive/components/user-message.ts +++ b/packages/coding-agent/src/modes/interactive/components/user-message.ts @@ -1,5 +1,5 @@ import { Container, Markdown, Spacer } from "@oh-my-pi/pi-tui"; -import { getMarkdownTheme, theme } from "../theme/theme"; +import { getMarkdownTheme, theme } from "$c/modes/interactive/theme/theme"; /** * Component that renders a user message diff --git a/packages/coding-agent/src/modes/interactive/components/welcome.ts b/packages/coding-agent/src/modes/interactive/components/welcome.ts index 38ee8df6b..147b63102 100644 --- a/packages/coding-agent/src/modes/interactive/components/welcome.ts +++ b/packages/coding-agent/src/modes/interactive/components/welcome.ts @@ -1,6 +1,6 @@ import { type Component, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui"; -import { APP_NAME } from "../../../config"; -import { theme } from "../theme/theme"; +import { APP_NAME } from "$c/config"; +import { theme } from "$c/modes/interactive/theme/theme"; export interface RecentSession { name: string; diff --git a/packages/coding-agent/src/modes/interactive/controllers/command-controller.ts b/packages/coding-agent/src/modes/interactive/controllers/command-controller.ts index d1fb215c9..b8330d116 100644 --- a/packages/coding-agent/src/modes/interactive/controllers/command-controller.ts +++ b/packages/coding-agent/src/modes/interactive/controllers/command-controller.ts @@ -5,21 +5,21 @@ import type { UsageLimit, UsageReport } from "@oh-my-pi/pi-ai"; import { Loader, Markdown, Spacer, Text, visibleWidth } from "@oh-my-pi/pi-tui"; import { $ } from "bun"; import { nanoid } from "nanoid"; -import { getDebugLogPath } from "../../../config"; -import { loadCustomShare } from "../../../core/custom-share"; -import type { CompactOptions } from "../../../core/extensions/types"; -import { createCompactionSummaryMessage } from "../../../core/messages"; -import { outputMeta } from "../../../core/output-meta"; -import { getGatewayStatus } from "../../../core/python-gateway-coordinator"; -import { getChangelogPath, parseChangelog } from "../../../utils/changelog"; -import { copyToClipboard } from "../../../utils/clipboard"; -import { ArminComponent } from "../components/armin"; -import { BashExecutionComponent } from "../components/bash-execution"; -import { BorderedLoader } from "../components/bordered-loader"; -import { DynamicBorder } from "../components/dynamic-border"; -import { PythonExecutionComponent } from "../components/python-execution"; -import { getMarkdownTheme, getSymbolTheme, theme } from "../theme/theme"; -import type { InteractiveModeContext } from "../types"; +import { getDebugLogPath } from "$c/config"; +import { loadCustomShare } from "$c/core/custom-share"; +import type { CompactOptions } from "$c/core/extensions/types"; +import { createCompactionSummaryMessage } from "$c/core/messages"; +import { outputMeta } from "$c/core/output-meta"; +import { getGatewayStatus } from "$c/core/python-gateway-coordinator"; +import { ArminComponent } from "$c/modes/interactive/components/armin"; +import { BashExecutionComponent } from "$c/modes/interactive/components/bash-execution"; +import { BorderedLoader } from "$c/modes/interactive/components/bordered-loader"; +import { DynamicBorder } from "$c/modes/interactive/components/dynamic-border"; +import { PythonExecutionComponent } from "$c/modes/interactive/components/python-execution"; +import { getMarkdownTheme, getSymbolTheme, theme } from "$c/modes/interactive/theme/theme"; +import type { InteractiveModeContext } from "$c/modes/interactive/types"; +import { getChangelogPath, parseChangelog } from "$c/utils/changelog"; +import { copyToClipboard } from "$c/utils/clipboard"; export class CommandController { constructor(private readonly ctx: InteractiveModeContext) {} diff --git a/packages/coding-agent/src/modes/interactive/controllers/event-controller.ts b/packages/coding-agent/src/modes/interactive/controllers/event-controller.ts index 524ebbf21..04d28c03f 100644 --- a/packages/coding-agent/src/modes/interactive/controllers/event-controller.ts +++ b/packages/coding-agent/src/modes/interactive/controllers/event-controller.ts @@ -1,13 +1,13 @@ import { Loader, Text } from "@oh-my-pi/pi-tui"; -import type { AgentSessionEvent } from "../../../core/agent-session"; -import { detectNotificationProtocol, isNotificationSuppressed, sendNotification } from "../../../core/terminal-notify"; -import { AssistantMessageComponent } from "../components/assistant-message"; -import { ReadToolGroupComponent } from "../components/read-tool-group"; -import { TodoReminderComponent } from "../components/todo-reminder"; -import { ToolExecutionComponent } from "../components/tool-execution"; -import { TtsrNotificationComponent } from "../components/ttsr-notification"; -import { getSymbolTheme, theme } from "../theme/theme"; -import type { InteractiveModeContext, TodoItem } from "../types"; +import type { AgentSessionEvent } from "$c/core/agent-session"; +import { detectNotificationProtocol, isNotificationSuppressed, sendNotification } from "$c/core/terminal-notify"; +import { AssistantMessageComponent } from "$c/modes/interactive/components/assistant-message"; +import { ReadToolGroupComponent } from "$c/modes/interactive/components/read-tool-group"; +import { TodoReminderComponent } from "$c/modes/interactive/components/todo-reminder"; +import { ToolExecutionComponent } from "$c/modes/interactive/components/tool-execution"; +import { TtsrNotificationComponent } from "$c/modes/interactive/components/ttsr-notification"; +import { getSymbolTheme, theme } from "$c/modes/interactive/theme/theme"; +import type { InteractiveModeContext, TodoItem } from "$c/modes/interactive/types"; export class EventController { private lastReadGroup: ReadToolGroupComponent | undefined = undefined; diff --git a/packages/coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts b/packages/coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts index c8369328c..b6d9b8984 100644 --- a/packages/coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts +++ b/packages/coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts @@ -7,14 +7,20 @@ import type { ExtensionContextActions, ExtensionError, ExtensionUIContext, -} from "../../../core/extensions/index"; -import { KeybindingsManager } from "../../../core/keybindings"; -import { setTerminalTitle } from "../../../core/title-generator"; -import { HookEditorComponent } from "../components/hook-editor"; -import { HookInputComponent } from "../components/hook-input"; -import { HookSelectorComponent } from "../components/hook-selector"; -import { getAvailableThemesWithPaths, getThemeByName, setTheme, type Theme, theme } from "../theme/theme"; -import type { InteractiveModeContext } from "../types"; +} from "$c/core/extensions/index"; +import { KeybindingsManager } from "$c/core/keybindings"; +import { setTerminalTitle } from "$c/core/title-generator"; +import { HookEditorComponent } from "$c/modes/interactive/components/hook-editor"; +import { HookInputComponent } from "$c/modes/interactive/components/hook-input"; +import { HookSelectorComponent } from "$c/modes/interactive/components/hook-selector"; +import { + getAvailableThemesWithPaths, + getThemeByName, + setTheme, + type Theme, + theme, +} from "$c/modes/interactive/theme/theme"; +import type { InteractiveModeContext } from "$c/modes/interactive/types"; export class ExtensionUiController { constructor(private ctx: InteractiveModeContext) {} diff --git a/packages/coding-agent/src/modes/interactive/controllers/input-controller.ts b/packages/coding-agent/src/modes/interactive/controllers/input-controller.ts index 7760cefe7..93e634da3 100644 --- a/packages/coding-agent/src/modes/interactive/controllers/input-controller.ts +++ b/packages/coding-agent/src/modes/interactive/controllers/input-controller.ts @@ -5,12 +5,12 @@ import * as os from "node:os"; import * as path from "node:path"; import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import { nanoid } from "nanoid"; -import type { AgentSessionEvent } from "../../../core/agent-session"; -import { generateSessionTitle, setTerminalTitle } from "../../../core/title-generator"; -import { readImageFromClipboard } from "../../../utils/clipboard"; -import { resizeImage } from "../../../utils/image-resize"; -import { theme } from "../theme/theme"; -import type { InteractiveModeContext } from "../types"; +import type { AgentSessionEvent } from "$c/core/agent-session"; +import { generateSessionTitle, setTerminalTitle } from "$c/core/title-generator"; +import { theme } from "$c/modes/interactive/theme/theme"; +import type { InteractiveModeContext } from "$c/modes/interactive/types"; +import { readImageFromClipboard } from "$c/utils/clipboard"; +import { resizeImage } from "$c/utils/image-resize"; interface Expandable { setExpanded(expanded: boolean): void; diff --git a/packages/coding-agent/src/modes/interactive/controllers/selector-controller.ts b/packages/coding-agent/src/modes/interactive/controllers/selector-controller.ts index ba193d4fd..3984d1c50 100644 --- a/packages/coding-agent/src/modes/interactive/controllers/selector-controller.ts +++ b/packages/coding-agent/src/modes/interactive/controllers/selector-controller.ts @@ -2,22 +2,22 @@ import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import type { OAuthProvider } from "@oh-my-pi/pi-ai"; import type { Component } from "@oh-my-pi/pi-tui"; import { Input, Loader, Spacer, Text } from "@oh-my-pi/pi-tui"; -import { getAgentDbPath } from "../../../config"; -import { SessionManager } from "../../../core/session-manager"; -import { setPreferredImageProvider, setPreferredWebSearchProvider } from "../../../core/tools/index"; -import { disableProvider, enableProvider } from "../../../discovery"; -import { AssistantMessageComponent } from "../components/assistant-message"; -import { ExtensionDashboard } from "../components/extensions"; -import { HistorySearchComponent } from "../components/history-search"; -import { ModelSelectorComponent } from "../components/model-selector"; -import { OAuthSelectorComponent } from "../components/oauth-selector"; -import { SessionSelectorComponent } from "../components/session-selector"; -import { SettingsSelectorComponent } from "../components/settings-selector"; -import { ToolExecutionComponent } from "../components/tool-execution"; -import { TreeSelectorComponent } from "../components/tree-selector"; -import { UserMessageSelectorComponent } from "../components/user-message-selector"; -import { getAvailableThemes, getSymbolTheme, setSymbolPreset, setTheme, theme } from "../theme/theme"; -import type { InteractiveModeContext } from "../types"; +import { getAgentDbPath } from "$c/config"; +import { SessionManager } from "$c/core/session-manager"; +import { setPreferredImageProvider, setPreferredWebSearchProvider } from "$c/core/tools/index"; +import { disableProvider, enableProvider } from "$c/discovery"; +import { AssistantMessageComponent } from "$c/modes/interactive/components/assistant-message"; +import { ExtensionDashboard } from "$c/modes/interactive/components/extensions"; +import { HistorySearchComponent } from "$c/modes/interactive/components/history-search"; +import { ModelSelectorComponent } from "$c/modes/interactive/components/model-selector"; +import { OAuthSelectorComponent } from "$c/modes/interactive/components/oauth-selector"; +import { SessionSelectorComponent } from "$c/modes/interactive/components/session-selector"; +import { SettingsSelectorComponent } from "$c/modes/interactive/components/settings-selector"; +import { ToolExecutionComponent } from "$c/modes/interactive/components/tool-execution"; +import { TreeSelectorComponent } from "$c/modes/interactive/components/tree-selector"; +import { UserMessageSelectorComponent } from "$c/modes/interactive/components/user-message-selector"; +import { getAvailableThemes, getSymbolTheme, setSymbolPreset, setTheme, theme } from "$c/modes/interactive/theme/theme"; +import type { InteractiveModeContext } from "$c/modes/interactive/types"; export class SelectorController { constructor(private ctx: InteractiveModeContext) {} diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts index f53ab92f7..f6ea88f0f 100644 --- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts +++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts @@ -18,16 +18,16 @@ import { } from "@oh-my-pi/pi-tui"; import { logger, postmortem } from "@oh-my-pi/pi-utils"; import chalk from "chalk"; -import type { AgentSession, AgentSessionEvent } from "../../core/agent-session"; -import type { ExtensionUIContext } from "../../core/extensions/index"; -import type { CompactOptions } from "../../core/extensions/types"; -import { HistoryStorage } from "../../core/history-storage"; -import { KeybindingsManager } from "../../core/keybindings"; -import type { SessionContext, SessionManager } from "../../core/session-manager"; -import { getRecentSessions } from "../../core/session-manager"; -import type { SettingsManager } from "../../core/settings-manager"; -import { loadSlashCommands } from "../../core/slash-commands"; -import { setTerminalTitle } from "../../core/title-generator"; +import type { AgentSession, AgentSessionEvent } from "$c/core/agent-session"; +import type { ExtensionUIContext } from "$c/core/extensions/index"; +import type { CompactOptions } from "$c/core/extensions/types"; +import { HistoryStorage } from "$c/core/history-storage"; +import { KeybindingsManager } from "$c/core/keybindings"; +import type { SessionContext, SessionManager } from "$c/core/session-manager"; +import { getRecentSessions } from "$c/core/session-manager"; +import type { SettingsManager } from "$c/core/settings-manager"; +import { loadSlashCommands } from "$c/core/slash-commands"; +import { setTerminalTitle } from "$c/core/title-generator"; import type { AssistantMessageComponent } from "./components/assistant-message"; import type { BashExecutionComponent } from "./components/bash-execution"; import { CustomEditor } from "./components/custom-editor"; diff --git a/packages/coding-agent/src/modes/interactive/theme/theme.ts b/packages/coding-agent/src/modes/interactive/theme/theme.ts index 65aec853e..34627aafb 100644 --- a/packages/coding-agent/src/modes/interactive/theme/theme.ts +++ b/packages/coding-agent/src/modes/interactive/theme/theme.ts @@ -6,7 +6,7 @@ import { type Static, Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; import chalk from "chalk"; import { highlight, supportsLanguage } from "cli-highlight"; -import { getCustomThemesDir } from "../../../config"; +import { getCustomThemesDir } from "$c/config"; // Embed theme JSON files at build time import darkThemeJson from "./dark.json" with { type: "json" }; import { defaultThemes } from "./defaults"; diff --git a/packages/coding-agent/src/modes/interactive/types.ts b/packages/coding-agent/src/modes/interactive/types.ts index 975a88ef1..f43f1cdf1 100644 --- a/packages/coding-agent/src/modes/interactive/types.ts +++ b/packages/coding-agent/src/modes/interactive/types.ts @@ -1,14 +1,14 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { AssistantMessage, ImageContent, Message, UsageReport } from "@oh-my-pi/pi-ai"; import type { Component, Container, Loader, Spacer, Text, TUI } from "@oh-my-pi/pi-tui"; -import type { AgentSession, AgentSessionEvent } from "../../core/agent-session"; -import type { ExtensionUIContext } from "../../core/extensions/index"; -import type { CompactOptions } from "../../core/extensions/types"; -import type { HistoryStorage } from "../../core/history-storage"; -import type { KeybindingsManager } from "../../core/keybindings"; -import type { MCPManager } from "../../core/mcp/index"; -import type { SessionContext, SessionManager } from "../../core/session-manager"; -import type { SettingsManager } from "../../core/settings-manager"; +import type { AgentSession, AgentSessionEvent } from "$c/core/agent-session"; +import type { ExtensionUIContext } from "$c/core/extensions/index"; +import type { CompactOptions } from "$c/core/extensions/types"; +import type { HistoryStorage } from "$c/core/history-storage"; +import type { KeybindingsManager } from "$c/core/keybindings"; +import type { MCPManager } from "$c/core/mcp/index"; +import type { SessionContext, SessionManager } from "$c/core/session-manager"; +import type { SettingsManager } from "$c/core/settings-manager"; import type { AssistantMessageComponent } from "./components/assistant-message"; import type { BashExecutionComponent } from "./components/bash-execution"; import type { CustomEditor } from "./components/custom-editor"; diff --git a/packages/coding-agent/src/modes/interactive/utils/ui-helpers.ts b/packages/coding-agent/src/modes/interactive/utils/ui-helpers.ts index bf5006df1..bbe9a640f 100644 --- a/packages/coding-agent/src/modes/interactive/utils/ui-helpers.ts +++ b/packages/coding-agent/src/modes/interactive/utils/ui-helpers.ts @@ -1,20 +1,20 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { AssistantMessage, Message } from "@oh-my-pi/pi-ai"; import { Spacer, Text, TruncatedText } from "@oh-my-pi/pi-tui"; -import type { CustomMessage } from "../../../core/messages"; -import type { SessionContext } from "../../../core/session-manager"; -import { AssistantMessageComponent } from "../components/assistant-message"; -import { BashExecutionComponent } from "../components/bash-execution"; -import { BranchSummaryMessageComponent } from "../components/branch-summary-message"; -import { CompactionSummaryMessageComponent } from "../components/compaction-summary-message"; -import { CustomMessageComponent } from "../components/custom-message"; -import { DynamicBorder } from "../components/dynamic-border"; -import { PythonExecutionComponent } from "../components/python-execution"; -import { ReadToolGroupComponent } from "../components/read-tool-group"; -import { ToolExecutionComponent } from "../components/tool-execution"; -import { UserMessageComponent } from "../components/user-message"; -import { theme } from "../theme/theme"; -import type { CompactionQueuedMessage, InteractiveModeContext } from "../types"; +import type { CustomMessage } from "$c/core/messages"; +import type { SessionContext } from "$c/core/session-manager"; +import { AssistantMessageComponent } from "$c/modes/interactive/components/assistant-message"; +import { BashExecutionComponent } from "$c/modes/interactive/components/bash-execution"; +import { BranchSummaryMessageComponent } from "$c/modes/interactive/components/branch-summary-message"; +import { CompactionSummaryMessageComponent } from "$c/modes/interactive/components/compaction-summary-message"; +import { CustomMessageComponent } from "$c/modes/interactive/components/custom-message"; +import { DynamicBorder } from "$c/modes/interactive/components/dynamic-border"; +import { PythonExecutionComponent } from "$c/modes/interactive/components/python-execution"; +import { ReadToolGroupComponent } from "$c/modes/interactive/components/read-tool-group"; +import { ToolExecutionComponent } from "$c/modes/interactive/components/tool-execution"; +import { UserMessageComponent } from "$c/modes/interactive/components/user-message"; +import { theme } from "$c/modes/interactive/theme/theme"; +import type { CompactionQueuedMessage, InteractiveModeContext } from "$c/modes/interactive/types"; type TextBlock = { type: "text"; text: string }; diff --git a/packages/coding-agent/src/modes/print-mode.ts b/packages/coding-agent/src/modes/print-mode.ts index c012dae00..37e16a981 100644 --- a/packages/coding-agent/src/modes/print-mode.ts +++ b/packages/coding-agent/src/modes/print-mode.ts @@ -7,7 +7,7 @@ */ import type { AssistantMessage, ImageContent } from "@oh-my-pi/pi-ai"; -import type { AgentSession } from "../core/agent-session"; +import type { AgentSession } from "$c/core/agent-session"; /** * Options for print mode. diff --git a/packages/coding-agent/src/modes/rpc/rpc-client.ts b/packages/coding-agent/src/modes/rpc/rpc-client.ts index 0be5e7344..7dd662216 100644 --- a/packages/coding-agent/src/modes/rpc/rpc-client.ts +++ b/packages/coding-agent/src/modes/rpc/rpc-client.ts @@ -7,9 +7,9 @@ import type { AgentEvent, AgentMessage, ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import type { ImageContent } from "@oh-my-pi/pi-ai"; import { createSanitizerStream, createSplitterStream, createTextDecoderStream, ptree } from "@oh-my-pi/pi-utils"; -import type { SessionStats } from "../../core/agent-session"; -import type { BashResult } from "../../core/bash-executor"; -import type { CompactionResult } from "../../core/compaction/index"; +import type { SessionStats } from "$c/core/agent-session"; +import type { BashResult } from "$c/core/bash-executor"; +import type { CompactionResult } from "$c/core/compaction/index"; import type { RpcCommand, RpcResponse, RpcSessionState } from "./rpc-types"; /** Distributive Omit that works with union types */ diff --git a/packages/coding-agent/src/modes/rpc/rpc-mode.ts b/packages/coding-agent/src/modes/rpc/rpc-mode.ts index d10c87c44..e6596766a 100644 --- a/packages/coding-agent/src/modes/rpc/rpc-mode.ts +++ b/packages/coding-agent/src/modes/rpc/rpc-mode.ts @@ -13,9 +13,9 @@ import { readLines } from "@oh-my-pi/pi-utils"; import { nanoid } from "nanoid"; -import type { AgentSession } from "../../core/agent-session"; -import type { ExtensionUIContext, ExtensionUIDialogOptions } from "../../core/extensions/index"; -import { type Theme, theme } from "../interactive/theme/theme"; +import type { AgentSession } from "$c/core/agent-session"; +import type { ExtensionUIContext, ExtensionUIDialogOptions } from "$c/core/extensions/index"; +import { type Theme, theme } from "$c/modes/interactive/theme/theme"; import type { RpcCommand, RpcExtensionUIRequest, diff --git a/packages/coding-agent/src/modes/rpc/rpc-types.ts b/packages/coding-agent/src/modes/rpc/rpc-types.ts index 962386b96..073816b02 100644 --- a/packages/coding-agent/src/modes/rpc/rpc-types.ts +++ b/packages/coding-agent/src/modes/rpc/rpc-types.ts @@ -7,9 +7,9 @@ import type { AgentMessage, ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, Model } from "@oh-my-pi/pi-ai"; -import type { SessionStats } from "../../core/agent-session"; -import type { BashResult } from "../../core/bash-executor"; -import type { CompactionResult } from "../../core/compaction/index"; +import type { SessionStats } from "$c/core/agent-session"; +import type { BashResult } from "$c/core/bash-executor"; +import type { CompactionResult } from "$c/core/compaction/index"; // ============================================================================ // RPC Commands (stdin) diff --git a/packages/coding-agent/src/utils/changelog.ts b/packages/coding-agent/src/utils/changelog.ts index 292644a76..a420cf626 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"; +export { getChangelogPath } from "$c/config"; diff --git a/packages/coding-agent/src/utils/image-convert.ts b/packages/coding-agent/src/utils/image-convert.ts index 897678ecf..014564017 100644 --- a/packages/coding-agent/src/utils/image-convert.ts +++ b/packages/coding-agent/src/utils/image-convert.ts @@ -1,4 +1,4 @@ -import * as photon from "../vendor/photon"; +import * as photon from "$c/vendor/photon"; /** * Convert image to PNG format for terminal display. diff --git a/packages/coding-agent/src/utils/image-resize.ts b/packages/coding-agent/src/utils/image-resize.ts index 2d4085553..725a6dd34 100644 --- a/packages/coding-agent/src/utils/image-resize.ts +++ b/packages/coding-agent/src/utils/image-resize.ts @@ -1,5 +1,5 @@ import type { ImageContent } from "@oh-my-pi/pi-ai"; -import * as photon from "../vendor/photon"; +import * as photon from "$c/vendor/photon"; export interface ImageResizeOptions { maxWidth?: number; // Default: 2000 diff --git a/packages/coding-agent/src/utils/shell.ts b/packages/coding-agent/src/utils/shell.ts index 790e63a3e..e16c0e662 100644 --- a/packages/coding-agent/src/utils/shell.ts +++ b/packages/coding-agent/src/utils/shell.ts @@ -1,7 +1,7 @@ import { constants } from "node:fs"; import { access } from "node:fs/promises"; import { $ } from "bun"; -import { SettingsManager } from "../core/settings-manager"; +import { SettingsManager } from "$c/core/settings-manager"; export interface ShellConfig { shell: string; diff --git a/packages/coding-agent/src/utils/tools-manager.ts b/packages/coding-agent/src/utils/tools-manager.ts index 4af4b0758..8c194f745 100644 --- a/packages/coding-agent/src/utils/tools-manager.ts +++ b/packages/coding-agent/src/utils/tools-manager.ts @@ -3,7 +3,7 @@ import { arch, platform } from "node:os"; import { join } from "node:path"; import { createTempDir, logger } from "@oh-my-pi/pi-utils"; import { $ } from "bun"; -import { APP_NAME, getBinDir } from "../config"; +import { APP_NAME, getBinDir } from "$c/config"; const TOOLS_DIR = getBinDir(); diff --git a/packages/coding-agent/test/agent-session-branching.test.ts b/packages/coding-agent/test/agent-session-branching.test.ts index de241f91d..62706793a 100644 --- a/packages/coding-agent/test/agent-session-branching.test.ts +++ b/packages/coding-agent/test/agent-session-branching.test.ts @@ -14,12 +14,12 @@ import { join } from "node:path"; import { Agent } from "@oh-my-pi/pi-agent-core"; import { getModel } from "@oh-my-pi/pi-ai"; import { nanoid } from "nanoid"; -import { AgentSession } from "../src/core/agent-session"; -import { AuthStorage } from "../src/core/auth-storage"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; -import { SettingsManager } from "../src/core/settings-manager"; -import { createTools, type ToolSession } from "../src/core/tools/index"; +import { AgentSession } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; +import { createTools, type ToolSession } from "$c/core/tools/index"; import { API_KEY } from "./utilities"; describe.skipIf(!API_KEY)("AgentSession branching", () => { diff --git a/packages/coding-agent/test/agent-session-compaction.test.ts b/packages/coding-agent/test/agent-session-compaction.test.ts index 0b55c1f1f..54aa57e8e 100644 --- a/packages/coding-agent/test/agent-session-compaction.test.ts +++ b/packages/coding-agent/test/agent-session-compaction.test.ts @@ -14,12 +14,12 @@ import { join } from "node:path"; import { Agent } from "@oh-my-pi/pi-agent-core"; import { getModel } from "@oh-my-pi/pi-ai"; import { nanoid } from "nanoid"; -import { AgentSession, type AgentSessionEvent } from "../src/core/agent-session"; -import { AuthStorage } from "../src/core/auth-storage"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; -import { SettingsManager } from "../src/core/settings-manager"; -import { createTools, type ToolSession } from "../src/core/tools/index"; +import { AgentSession, type AgentSessionEvent } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; +import { createTools, type ToolSession } from "$c/core/tools/index"; import { API_KEY } from "./utilities"; describe.skipIf(!API_KEY)("AgentSession compaction e2e", () => { diff --git a/packages/coding-agent/test/agent-session-concurrent.test.ts b/packages/coding-agent/test/agent-session-concurrent.test.ts index a21516b06..aca7e4ee3 100644 --- a/packages/coding-agent/test/agent-session-concurrent.test.ts +++ b/packages/coding-agent/test/agent-session-concurrent.test.ts @@ -9,11 +9,11 @@ import { join } from "node:path"; import { Agent } from "@oh-my-pi/pi-agent-core"; import { type AssistantMessage, type AssistantMessageEvent, EventStream, getModel } from "@oh-my-pi/pi-ai"; import { nanoid } from "nanoid"; -import { AgentSession } from "../src/core/agent-session"; -import { AuthStorage } from "../src/core/auth-storage"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; -import { SettingsManager } from "../src/core/settings-manager"; +import { AgentSession } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; // Mock stream that mimics AssistantMessageEventStream class MockAssistantStream extends EventStream { diff --git a/packages/coding-agent/test/args.test.ts b/packages/coding-agent/test/args.test.ts index 3b78bc94b..87bcee8de 100644 --- a/packages/coding-agent/test/args.test.ts +++ b/packages/coding-agent/test/args.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { parseArgs } from "../src/cli/args"; +import { parseArgs } from "$c/cli/args"; describe("parseArgs", () => { describe("--version flag", () => { diff --git a/packages/coding-agent/test/block-images.test.ts b/packages/coding-agent/test/block-images.test.ts index 5e0a80049..575e616b3 100644 --- a/packages/coding-agent/test/block-images.test.ts +++ b/packages/coding-agent/test/block-images.test.ts @@ -2,10 +2,10 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test"; import { mkdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { processFileArguments } from "../src/cli/file-processor"; -import { SettingsManager } from "../src/core/settings-manager"; -import type { ToolSession } from "../src/core/tools/index"; -import { ReadTool } from "../src/core/tools/read"; +import { processFileArguments } from "$c/cli/file-processor"; +import { SettingsManager } from "$c/core/settings-manager"; +import type { ToolSession } from "$c/core/tools/index"; +import { ReadTool } from "$c/core/tools/read"; // 1x1 red PNG image as base64 (smallest valid PNG) const TINY_PNG_BASE64 = diff --git a/packages/coding-agent/test/compaction-hooks-example.test.ts b/packages/coding-agent/test/compaction-hooks-example.test.ts index 373c833d9..94cb4c0cd 100644 --- a/packages/coding-agent/test/compaction-hooks-example.test.ts +++ b/packages/coding-agent/test/compaction-hooks-example.test.ts @@ -3,7 +3,7 @@ */ import { describe, expect, it } from "bun:test"; -import type { HookAPI, SessionBeforeCompactEvent, SessionCompactEvent } from "../src/core/hooks/index"; +import type { HookAPI, SessionBeforeCompactEvent, SessionCompactEvent } from "$c/core/hooks/index"; describe("Documentation example", () => { it("custom compaction example should type-check correctly", () => { diff --git a/packages/coding-agent/test/compaction-hooks.test.ts b/packages/coding-agent/test/compaction-hooks.test.ts index 67a643bb7..711c940b9 100644 --- a/packages/coding-agent/test/compaction-hooks.test.ts +++ b/packages/coding-agent/test/compaction-hooks.test.ts @@ -9,20 +9,20 @@ import { join } from "node:path"; import { Agent } from "@oh-my-pi/pi-agent-core"; import { getModel } from "@oh-my-pi/pi-ai"; import { nanoid } from "nanoid"; -import { AgentSession } from "../src/core/agent-session"; -import { AuthStorage } from "../src/core/auth-storage"; +import { AgentSession } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; import { HookRunner, type LoadedHook, type SessionBeforeCompactEvent, type SessionCompactEvent, type SessionEvent, -} from "../src/core/hooks/index"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; -import { SettingsManager } from "../src/core/settings-manager"; -import { createTools, type ToolSession } from "../src/core/tools/index"; -import { theme } from "../src/modes/interactive/theme/theme"; +} from "$c/core/hooks/index"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; +import { createTools, type ToolSession } from "$c/core/tools/index"; +import { theme } from "$c/modes/interactive/theme/theme"; const API_KEY = process.env.ANTHROPIC_OAUTH_TOKEN || process.env.ANTHROPIC_API_KEY; diff --git a/packages/coding-agent/test/compaction-thinking-model.test.ts b/packages/coding-agent/test/compaction-thinking-model.test.ts index 460185637..d840effba 100644 --- a/packages/coding-agent/test/compaction-thinking-model.test.ts +++ b/packages/coding-agent/test/compaction-thinking-model.test.ts @@ -15,12 +15,12 @@ import { join } from "node:path"; import { Agent, type ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import { getModel, type Model } from "@oh-my-pi/pi-ai"; import { nanoid } from "nanoid"; -import { AgentSession } from "../src/core/agent-session"; -import { AuthStorage } from "../src/core/auth-storage"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; -import { SettingsManager } from "../src/core/settings-manager"; -import { createTools, type ToolSession } from "../src/core/tools/index"; +import { AgentSession } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; +import { createTools, type ToolSession } from "$c/core/tools/index"; import { API_KEY } from "./utilities"; // Check for auth diff --git a/packages/coding-agent/test/compaction.test.ts b/packages/coding-agent/test/compaction.test.ts index 33d2f04f6..a3c8b000b 100644 --- a/packages/coding-agent/test/compaction.test.ts +++ b/packages/coding-agent/test/compaction.test.ts @@ -13,7 +13,7 @@ import { getLastAssistantUsage, prepareCompaction, shouldCompact, -} from "../src/core/compaction/index"; +} from "$c/core/compaction/index"; import { buildSessionContext, type CompactionEntry, @@ -23,7 +23,7 @@ import { type SessionEntry, type SessionMessageEntry, type ThinkingLevelChangeEntry, -} from "../src/core/session-manager"; +} from "$c/core/session-manager"; // ============================================================================ // Test fixtures diff --git a/packages/coding-agent/test/core/apply-patch-adverserial.test.ts b/packages/coding-agent/test/core/apply-patch-adverserial.test.ts index 95069de07..7d96a39e0 100644 --- a/packages/coding-agent/test/core/apply-patch-adverserial.test.ts +++ b/packages/coding-agent/test/core/apply-patch-adverserial.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from "bun:test"; import { mkdirSync, readFileSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { ApplyPatchError, applyPatch } from "../../src/core/tools/patch"; +import { ApplyPatchError, applyPatch } from "$c/core/tools/patch"; describe("applyPatch adversarial inputs", () => { let tempDir: string; diff --git a/packages/coding-agent/test/core/apply-patch-regression.test.ts b/packages/coding-agent/test/core/apply-patch-regression.test.ts index 1b28efa03..2f82264f8 100644 --- a/packages/coding-agent/test/core/apply-patch-regression.test.ts +++ b/packages/coding-agent/test/core/apply-patch-regression.test.ts @@ -10,7 +10,7 @@ import { afterEach, beforeEach, describe, expect, test } from "bun:test"; import { mkdirSync, readFileSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { applyPatch, findContextLine, seekSequence } from "../../src/core/tools/patch"; +import { applyPatch, findContextLine, seekSequence } from "$c/core/tools/patch"; describe("regression: indentation adjustment for line-based replacements (2B)", () => { let tempDir: string; diff --git a/packages/coding-agent/test/core/apply-patch.test.ts b/packages/coding-agent/test/core/apply-patch.test.ts index d3ab399a8..631369a29 100644 --- a/packages/coding-agent/test/core/apply-patch.test.ts +++ b/packages/coding-agent/test/core/apply-patch.test.ts @@ -9,7 +9,7 @@ import { type PatchInput, parseDiffHunks, seekSequence, -} from "../../src/core/tools/patch"; +} from "$c/core/tools/patch"; // ═══════════════════════════════════════════════════════════════════════════ // Legacy parser for test fixtures (*** Begin Patch format) diff --git a/packages/coding-agent/test/core/python-executor-display.test.ts b/packages/coding-agent/test/core/python-executor-display.test.ts index a03dd828b..6a9f8305d 100644 --- a/packages/coding-agent/test/core/python-executor-display.test.ts +++ b/packages/coding-agent/test/core/python-executor-display.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { executePythonWithKernel, type PythonKernelExecutor } from "../../src/core/python-executor"; -import type { KernelDisplayOutput, KernelExecuteOptions, KernelExecuteResult } from "../../src/core/python-kernel"; +import { executePythonWithKernel, type PythonKernelExecutor } from "$c/core/python-executor"; +import type { KernelDisplayOutput, KernelExecuteOptions, KernelExecuteResult } from "$c/core/python-kernel"; class FakeKernel implements PythonKernelExecutor { private result: KernelExecuteResult; diff --git a/packages/coding-agent/test/core/python-executor-lifecycle.test.ts b/packages/coding-agent/test/core/python-executor-lifecycle.test.ts index 54a32e7f7..918923b8f 100644 --- a/packages/coding-agent/test/core/python-executor-lifecycle.test.ts +++ b/packages/coding-agent/test/core/python-executor-lifecycle.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from "bun:test"; -import { disposeAllKernelSessions, executePython } from "../../src/core/python-executor"; -import type { KernelExecuteResult } from "../../src/core/python-kernel"; -import * as pythonKernel from "../../src/core/python-kernel"; +import { disposeAllKernelSessions, executePython } from "$c/core/python-executor"; +import type { KernelExecuteResult } from "$c/core/python-kernel"; +import * as pythonKernel from "$c/core/python-kernel"; class FakeKernel { execute = vi.fn(async () => this.result); diff --git a/packages/coding-agent/test/core/python-executor-mapping.test.ts b/packages/coding-agent/test/core/python-executor-mapping.test.ts index 3bf38c55c..e9af38413 100644 --- a/packages/coding-agent/test/core/python-executor-mapping.test.ts +++ b/packages/coding-agent/test/core/python-executor-mapping.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { executePythonWithKernel, type PythonKernelExecutor } from "../../src/core/python-executor"; -import type { KernelExecuteOptions, KernelExecuteResult } from "../../src/core/python-kernel"; +import { executePythonWithKernel, type PythonKernelExecutor } from "$c/core/python-executor"; +import type { KernelExecuteOptions, KernelExecuteResult } from "$c/core/python-kernel"; class FakeKernel implements PythonKernelExecutor { constructor( diff --git a/packages/coding-agent/test/core/python-executor-per-call.test.ts b/packages/coding-agent/test/core/python-executor-per-call.test.ts index 484197573..853337d06 100644 --- a/packages/coding-agent/test/core/python-executor-per-call.test.ts +++ b/packages/coding-agent/test/core/python-executor-per-call.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "bun:test"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import { executePython } from "../../src/core/python-executor"; -import type { KernelExecuteOptions, KernelExecuteResult } from "../../src/core/python-kernel"; -import { PythonKernel } from "../../src/core/python-kernel"; +import { executePython } from "$c/core/python-executor"; +import type { KernelExecuteOptions, KernelExecuteResult } from "$c/core/python-kernel"; +import { PythonKernel } from "$c/core/python-kernel"; interface KernelStub { execute: (code: string, options?: KernelExecuteOptions) => Promise; diff --git a/packages/coding-agent/test/core/python-executor-session.test.ts b/packages/coding-agent/test/core/python-executor-session.test.ts index 1d28750b5..b067d7f42 100644 --- a/packages/coding-agent/test/core/python-executor-session.test.ts +++ b/packages/coding-agent/test/core/python-executor-session.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from "bun:test"; -import { disposeAllKernelSessions, executePython } from "../../src/core/python-executor"; -import * as pythonKernel from "../../src/core/python-kernel"; +import { disposeAllKernelSessions, executePython } from "$c/core/python-executor"; +import * as pythonKernel from "$c/core/python-kernel"; class FakeKernel { executeCalls = 0; diff --git a/packages/coding-agent/test/core/python-executor-streaming.test.ts b/packages/coding-agent/test/core/python-executor-streaming.test.ts index 4c9a4f3c2..2380b922c 100644 --- a/packages/coding-agent/test/core/python-executor-streaming.test.ts +++ b/packages/coding-agent/test/core/python-executor-streaming.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; -import { executePythonWithKernel, type PythonKernelExecutor } from "../../src/core/python-executor"; -import type { KernelExecuteOptions, KernelExecuteResult } from "../../src/core/python-kernel"; -import { DEFAULT_MAX_BYTES } from "../../src/core/tools/truncate"; +import { executePythonWithKernel, type PythonKernelExecutor } from "$c/core/python-executor"; +import type { KernelExecuteOptions, KernelExecuteResult } from "$c/core/python-kernel"; +import { DEFAULT_MAX_BYTES } from "$c/core/tools/truncate"; class FakeKernel implements PythonKernelExecutor { private result: KernelExecuteResult; diff --git a/packages/coding-agent/test/core/python-executor-timeout.test.ts b/packages/coding-agent/test/core/python-executor-timeout.test.ts index f819d02c8..6ae6d766a 100644 --- a/packages/coding-agent/test/core/python-executor-timeout.test.ts +++ b/packages/coding-agent/test/core/python-executor-timeout.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { executePythonWithKernel, type PythonKernelExecutor } from "../../src/core/python-executor"; -import type { KernelExecuteOptions, KernelExecuteResult } from "../../src/core/python-kernel"; +import { executePythonWithKernel, type PythonKernelExecutor } from "$c/core/python-executor"; +import type { KernelExecuteOptions, KernelExecuteResult } from "$c/core/python-kernel"; class FakeKernel implements PythonKernelExecutor { private result: KernelExecuteResult; diff --git a/packages/coding-agent/test/core/python-executor.lifecycle.test.ts b/packages/coding-agent/test/core/python-executor.lifecycle.test.ts index e8c40ca59..31c683c64 100644 --- a/packages/coding-agent/test/core/python-executor.lifecycle.test.ts +++ b/packages/coding-agent/test/core/python-executor.lifecycle.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it } from "bun:test"; -import { disposeAllKernelSessions, executePython } from "../../src/core/python-executor"; -import { type KernelExecuteOptions, type KernelExecuteResult, PythonKernel } from "../../src/core/python-kernel"; +import { disposeAllKernelSessions, executePython } from "$c/core/python-executor"; +import { type KernelExecuteOptions, type KernelExecuteResult, PythonKernel } from "$c/core/python-kernel"; process.env.OMP_PYTHON_SKIP_CHECK = "1"; diff --git a/packages/coding-agent/test/core/python-executor.result.test.ts b/packages/coding-agent/test/core/python-executor.result.test.ts index 356db6d59..040f66f5a 100644 --- a/packages/coding-agent/test/core/python-executor.result.test.ts +++ b/packages/coding-agent/test/core/python-executor.result.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { executePythonWithKernel, type PythonKernelExecutor } from "../../src/core/python-executor"; -import type { KernelExecuteOptions, KernelExecuteResult } from "../../src/core/python-kernel"; +import { executePythonWithKernel, type PythonKernelExecutor } from "$c/core/python-executor"; +import type { KernelExecuteOptions, KernelExecuteResult } from "$c/core/python-kernel"; class FakeKernel implements PythonKernelExecutor { private result: KernelExecuteResult; diff --git a/packages/coding-agent/test/core/python-executor.test.ts b/packages/coding-agent/test/core/python-executor.test.ts index d6e5bf058..2d5501d28 100644 --- a/packages/coding-agent/test/core/python-executor.test.ts +++ b/packages/coding-agent/test/core/python-executor.test.ts @@ -8,14 +8,14 @@ import { type PythonKernelExecutor, resetPreludeDocsCache, warmPythonEnvironment, -} from "../../src/core/python-executor"; +} from "$c/core/python-executor"; import { type KernelExecuteOptions, type KernelExecuteResult, type PreludeHelper, PythonKernel, -} from "../../src/core/python-kernel"; -import { DEFAULT_MAX_BYTES } from "../../src/core/tools/truncate"; +} from "$c/core/python-kernel"; +import { DEFAULT_MAX_BYTES } from "$c/core/tools/truncate"; class FakeKernel implements PythonKernelExecutor { private result: KernelExecuteResult; diff --git a/packages/coding-agent/test/core/python-kernel-display.test.ts b/packages/coding-agent/test/core/python-kernel-display.test.ts index e8893c845..4e28df2aa 100644 --- a/packages/coding-agent/test/core/python-kernel-display.test.ts +++ b/packages/coding-agent/test/core/python-kernel-display.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { type KernelDisplayOutput, PythonKernel } from "../../src/core/python-kernel"; +import { type KernelDisplayOutput, PythonKernel } from "$c/core/python-kernel"; const renderDisplay = ( PythonKernel as unknown as { diff --git a/packages/coding-agent/test/core/python-kernel-env.test.ts b/packages/coding-agent/test/core/python-kernel-env.test.ts index 73b9af06b..9079e8b7d 100644 --- a/packages/coding-agent/test/core/python-kernel-env.test.ts +++ b/packages/coding-agent/test/core/python-kernel-env.test.ts @@ -1,9 +1,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "bun:test"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import { PythonKernel } from "../../src/core/python-kernel"; -import { PYTHON_PRELUDE } from "../../src/core/python-prelude"; -import * as shell from "../../src/utils/shell"; -import * as shellSnapshot from "../../src/utils/shell-snapshot"; +import { PythonKernel } from "$c/core/python-kernel"; +import { PYTHON_PRELUDE } from "$c/core/python-prelude"; +import * as shell from "$c/utils/shell"; +import * as shellSnapshot from "$c/utils/shell-snapshot"; class FakeWebSocket { static OPEN = 1; diff --git a/packages/coding-agent/test/core/python-kernel-session.test.ts b/packages/coding-agent/test/core/python-kernel-session.test.ts index f8d3e3d7f..a2b53c971 100644 --- a/packages/coding-agent/test/core/python-kernel-session.test.ts +++ b/packages/coding-agent/test/core/python-kernel-session.test.ts @@ -1,8 +1,8 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import { disposeAllKernelSessions, executePython } from "../../src/core/python-executor"; -import type { KernelExecuteOptions, KernelExecuteResult } from "../../src/core/python-kernel"; -import { PythonKernel } from "../../src/core/python-kernel"; +import { disposeAllKernelSessions, executePython } from "$c/core/python-executor"; +import type { KernelExecuteOptions, KernelExecuteResult } from "$c/core/python-kernel"; +import { PythonKernel } from "$c/core/python-kernel"; class FakeKernel { executeCalls = 0; diff --git a/packages/coding-agent/test/core/python-kernel-ws.test.ts b/packages/coding-agent/test/core/python-kernel-ws.test.ts index 032f117ba..6e54ae527 100644 --- a/packages/coding-agent/test/core/python-kernel-ws.test.ts +++ b/packages/coding-agent/test/core/python-kernel-ws.test.ts @@ -1,9 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { - deserializeWebSocketMessage, - type JupyterMessage, - serializeWebSocketMessage, -} from "../../src/core/python-kernel"; +import { deserializeWebSocketMessage, type JupyterMessage, serializeWebSocketMessage } from "$c/core/python-kernel"; const encoder = new TextEncoder(); diff --git a/packages/coding-agent/test/core/python-kernel.lifecycle.test.ts b/packages/coding-agent/test/core/python-kernel.lifecycle.test.ts index be50ccd9a..4139fa1cd 100644 --- a/packages/coding-agent/test/core/python-kernel.lifecycle.test.ts +++ b/packages/coding-agent/test/core/python-kernel.lifecycle.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test"; import { rmSync } from "node:fs"; import { createTempDirSync, type SyncTempDir } from "@oh-my-pi/pi-utils"; import type { Subprocess } from "bun"; -import { PythonKernel } from "../../src/core/python-kernel"; +import { PythonKernel } from "$c/core/python-kernel"; type SpawnOptions = Parameters[1]; diff --git a/packages/coding-agent/test/core/python-kernel.test.ts b/packages/coding-agent/test/core/python-kernel.test.ts index 249480132..7b7494cc6 100644 --- a/packages/coding-agent/test/core/python-kernel.test.ts +++ b/packages/coding-agent/test/core/python-kernel.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "bun:test"; -import { type KernelDisplayOutput, PythonKernel } from "../../src/core/python-kernel"; -import { PYTHON_PRELUDE } from "../../src/core/python-prelude"; +import { type KernelDisplayOutput, PythonKernel } from "$c/core/python-kernel"; +import { PYTHON_PRELUDE } from "$c/core/python-prelude"; type JupyterMessage = { channel: string; diff --git a/packages/coding-agent/test/core/python-modules.test.ts b/packages/coding-agent/test/core/python-modules.test.ts index 830c798ec..708861ab3 100644 --- a/packages/coding-agent/test/core/python-modules.test.ts +++ b/packages/coding-agent/test/core/python-modules.test.ts @@ -2,7 +2,7 @@ import { afterEach, describe, expect, it } from "bun:test"; import { mkdirSync, readFileSync, writeFileSync } from "node:fs"; import { basename, join, resolve } from "node:path"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import { discoverPythonModules, loadPythonModules, type PythonModuleExecutor } from "../../src/core/python-modules"; +import { discoverPythonModules, loadPythonModules, type PythonModuleExecutor } from "$c/core/python-modules"; const fixturesDir = resolve(import.meta.dir, "../../test/fixtures/python-modules"); diff --git a/packages/coding-agent/test/core/python-prelude.test.ts b/packages/coding-agent/test/core/python-prelude.test.ts index 87468d697..ba661b661 100644 --- a/packages/coding-agent/test/core/python-prelude.test.ts +++ b/packages/coding-agent/test/core/python-prelude.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "bun:test"; import { existsSync } from "node:fs"; import { join } from "node:path"; -import { resetPreludeDocsCache, warmPythonEnvironment } from "../../src/core/python-executor"; -import { getPythonToolDescription, PythonTool } from "../../src/core/tools/python"; +import { resetPreludeDocsCache, warmPythonEnvironment } from "$c/core/python-executor"; +import { getPythonToolDescription, PythonTool } from "$c/core/tools/python"; const resolvePythonPath = (): string | null => { const venvPath = process.env.VIRTUAL_ENV; diff --git a/packages/coding-agent/test/core/settings-manager-python.test.ts b/packages/coding-agent/test/core/settings-manager-python.test.ts index c5f4fc78f..afa1dc1d1 100644 --- a/packages/coding-agent/test/core/settings-manager-python.test.ts +++ b/packages/coding-agent/test/core/settings-manager-python.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { SettingsManager } from "../../src/core/settings-manager"; +import { SettingsManager } from "$c/core/settings-manager"; describe("SettingsManager python settings", () => { it("defaults to both and session", () => { diff --git a/packages/coding-agent/test/core/system-prompt.python.test.ts b/packages/coding-agent/test/core/system-prompt.python.test.ts index 5c8d304a4..285f0fc92 100644 --- a/packages/coding-agent/test/core/system-prompt.python.test.ts +++ b/packages/coding-agent/test/core/system-prompt.python.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { buildSystemPrompt } from "../../src/core/system-prompt"; +import { buildSystemPrompt } from "$c/core/system-prompt"; describe("buildSystemPrompt", () => { it("includes python tool details when enabled", async () => { diff --git a/packages/coding-agent/test/discovery/helpers.test.ts b/packages/coding-agent/test/discovery/helpers.test.ts index a2d203d56..f7d2bb2db 100644 --- a/packages/coding-agent/test/discovery/helpers.test.ts +++ b/packages/coding-agent/test/discovery/helpers.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { parseFrontmatter } from "../../src/core/frontmatter"; +import { parseFrontmatter } from "$c/core/frontmatter"; describe("parseFrontmatter", () => { const parse = (content: string) => parseFrontmatter(content, { source: "tests:frontmatter", level: "off" }); diff --git a/packages/coding-agent/test/edit-diff.test.ts b/packages/coding-agent/test/edit-diff.test.ts index 3d0793bb2..1d45a5b94 100644 --- a/packages/coding-agent/test/edit-diff.test.ts +++ b/packages/coding-agent/test/edit-diff.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { adjustIndentation, DEFAULT_FUZZY_THRESHOLD, findEditMatch } from "../src/core/tools/patch"; +import { adjustIndentation, DEFAULT_FUZZY_THRESHOLD, findEditMatch } from "$c/core/tools/patch"; describe("findEditMatch", () => { describe("exact matching", () => { diff --git a/packages/coding-agent/test/extensions-discovery.test.ts b/packages/coding-agent/test/extensions-discovery.test.ts index 9fae0f889..bdc24f6b8 100644 --- a/packages/coding-agent/test/extensions-discovery.test.ts +++ b/packages/coding-agent/test/extensions-discovery.test.ts @@ -3,7 +3,7 @@ import * as fs from "node:fs"; import * as path from "node:path"; import { fileURLToPath } from "node:url"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import { discoverAndLoadExtensions, loadExtensions } from "../src/core/extensions/loader"; +import { discoverAndLoadExtensions, loadExtensions } from "$c/core/extensions/loader"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); diff --git a/packages/coding-agent/test/extensions-runner.test.ts b/packages/coding-agent/test/extensions-runner.test.ts index 128e41fbd..af4f02e45 100644 --- a/packages/coding-agent/test/extensions-runner.test.ts +++ b/packages/coding-agent/test/extensions-runner.test.ts @@ -6,11 +6,11 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "bun:test"; import { mkdirSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { createTempDirSync, logger } from "@oh-my-pi/pi-utils"; -import { AuthStorage } from "../src/core/auth-storage"; -import { discoverAndLoadExtensions } from "../src/core/extensions/loader"; -import { ExtensionRunner } from "../src/core/extensions/runner"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; +import { AuthStorage } from "$c/core/auth-storage"; +import { discoverAndLoadExtensions } from "$c/core/extensions/loader"; +import { ExtensionRunner } from "$c/core/extensions/runner"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; describe("ExtensionRunner", () => { let tempDir: ReturnType; diff --git a/packages/coding-agent/test/fuzzy.test.ts b/packages/coding-agent/test/fuzzy.test.ts index 2476918c5..ebf8f3e18 100644 --- a/packages/coding-agent/test/fuzzy.test.ts +++ b/packages/coding-agent/test/fuzzy.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { fuzzyFilter, fuzzyMatch } from "../src/utils/fuzzy"; +import { fuzzyFilter, fuzzyMatch } from "$c/utils/fuzzy"; describe("fuzzyMatch", () => { test("empty query matches everything with score 0", () => { diff --git a/packages/coding-agent/test/interactive-mode-status.test.ts b/packages/coding-agent/test/interactive-mode-status.test.ts index a3c9b339d..566859d3d 100644 --- a/packages/coding-agent/test/interactive-mode-status.test.ts +++ b/packages/coding-agent/test/interactive-mode-status.test.ts @@ -1,8 +1,8 @@ import { beforeAll, describe, expect, test, vi } from "bun:test"; import { Container } from "@oh-my-pi/pi-tui"; -import { InteractiveMode } from "../src/modes/interactive/interactive-mode"; -import { initTheme } from "../src/modes/interactive/theme/theme"; -import { UiHelpers } from "../src/modes/interactive/utils/ui-helpers"; +import { InteractiveMode } from "$c/modes/interactive/interactive-mode"; +import { initTheme } from "$c/modes/interactive/theme/theme"; +import { UiHelpers } from "$c/modes/interactive/utils/ui-helpers"; function renderLastLine(container: Container, width = 120): string { const last = container.children[container.children.length - 1]; diff --git a/packages/coding-agent/test/model-registry.test.ts b/packages/coding-agent/test/model-registry.test.ts index 5be1d22a7..4ea780c72 100644 --- a/packages/coding-agent/test/model-registry.test.ts +++ b/packages/coding-agent/test/model-registry.test.ts @@ -3,8 +3,8 @@ import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { nanoid } from "nanoid"; -import { AuthStorage } from "../src/core/auth-storage"; -import { ModelRegistry } from "../src/core/model-registry"; +import { AuthStorage } from "$c/core/auth-storage"; +import { ModelRegistry } from "$c/core/model-registry"; describe("ModelRegistry", () => { let tempDir: string; diff --git a/packages/coding-agent/test/model-resolver.test.ts b/packages/coding-agent/test/model-resolver.test.ts index 962d4b590..febc6863f 100644 --- a/packages/coding-agent/test/model-resolver.test.ts +++ b/packages/coding-agent/test/model-resolver.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "bun:test"; import type { Model } from "@oh-my-pi/pi-ai"; -import { parseModelPattern } from "../src/core/model-resolver"; +import { parseModelPattern } from "$c/core/model-resolver"; // Mock models for testing const mockModels: Model<"anthropic-messages">[] = [ diff --git a/packages/coding-agent/test/prompt-templates.test.ts b/packages/coding-agent/test/prompt-templates.test.ts index 1c0a6e035..5a4dd32d3 100644 --- a/packages/coding-agent/test/prompt-templates.test.ts +++ b/packages/coding-agent/test/prompt-templates.test.ts @@ -9,7 +9,7 @@ */ import { describe, expect, test } from "bun:test"; -import { parseCommandArgs, substituteArgs } from "../src/core/prompt-templates"; +import { parseCommandArgs, substituteArgs } from "$c/core/prompt-templates"; // ============================================================================ // substituteArgs diff --git a/packages/coding-agent/test/python-tool-settings.test.ts b/packages/coding-agent/test/python-tool-settings.test.ts index 9f0228749..1a37be042 100644 --- a/packages/coding-agent/test/python-tool-settings.test.ts +++ b/packages/coding-agent/test/python-tool-settings.test.ts @@ -2,10 +2,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "bun:test"; import { mkdirSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import * as pythonExecutor from "../src/core/python-executor"; -import * as pythonKernel from "../src/core/python-kernel"; -import { createTools, type ToolSession } from "../src/core/tools/index"; -import { PythonTool } from "../src/core/tools/python"; +import * as pythonExecutor from "$c/core/python-executor"; +import * as pythonKernel from "$c/core/python-kernel"; +import { createTools, type ToolSession } from "$c/core/tools/index"; +import { PythonTool } from "$c/core/tools/python"; function createSettings(overrides?: Partial): ToolSession["settings"] { return { diff --git a/packages/coding-agent/test/rpc-example.ts b/packages/coding-agent/test/rpc-example.ts index f1c17aeba..1920a0b81 100644 --- a/packages/coding-agent/test/rpc-example.ts +++ b/packages/coding-agent/test/rpc-example.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; import * as readline from "node:readline"; -import { RpcClient } from "../src/modes/rpc/rpc-client"; +import { RpcClient } from "$c/modes/rpc/rpc-client"; /** * Interactive example of using coding-agent via RpcClient. diff --git a/packages/coding-agent/test/rpc.test.ts b/packages/coding-agent/test/rpc.test.ts index c02d9e57a..9c60a6657 100644 --- a/packages/coding-agent/test/rpc.test.ts +++ b/packages/coding-agent/test/rpc.test.ts @@ -4,7 +4,7 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import type { AgentEvent } from "@oh-my-pi/pi-agent-core"; import { nanoid } from "nanoid"; -import { RpcClient } from "../src/modes/rpc/rpc-client"; +import { RpcClient } from "$c/modes/rpc/rpc-client"; /** * RPC mode tests. diff --git a/packages/coding-agent/test/sdk-skills.test.ts b/packages/coding-agent/test/sdk-skills.test.ts index 4983de5f9..f8ca880e5 100644 --- a/packages/coding-agent/test/sdk-skills.test.ts +++ b/packages/coding-agent/test/sdk-skills.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test"; import { mkdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import type { Skill } from "../src/core/sdk"; -import { createAgentSession } from "../src/core/sdk"; -import { SessionManager } from "../src/core/session-manager"; +import type { Skill } from "$c/core/sdk"; +import { createAgentSession } from "$c/core/sdk"; +import { SessionManager } from "$c/core/session-manager"; describe("createAgentSession skills option", () => { let tempDir: string; diff --git a/packages/coding-agent/test/session-manager/build-context.test.ts b/packages/coding-agent/test/session-manager/build-context.test.ts index fae97ca72..9247685ba 100644 --- a/packages/coding-agent/test/session-manager/build-context.test.ts +++ b/packages/coding-agent/test/session-manager/build-context.test.ts @@ -7,7 +7,7 @@ import { type SessionEntry, type SessionMessageEntry, type ThinkingLevelChangeEntry, -} from "../../src/core/session-manager"; +} from "$c/core/session-manager"; function msg(id: string, parentId: string | null, role: "user" | "assistant", text: string): SessionMessageEntry { const base = { type: "message" as const, id, parentId, timestamp: "2025-01-01T00:00:00Z" }; diff --git a/packages/coding-agent/test/session-manager/file-operations.test.ts b/packages/coding-agent/test/session-manager/file-operations.test.ts index e647996c2..558849351 100644 --- a/packages/coding-agent/test/session-manager/file-operations.test.ts +++ b/packages/coding-agent/test/session-manager/file-operations.test.ts @@ -3,7 +3,7 @@ import { mkdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { nanoid } from "nanoid"; -import { findMostRecentSession, loadEntriesFromFile } from "../../src/core/session-manager"; +import { findMostRecentSession, loadEntriesFromFile } from "$c/core/session-manager"; describe("loadEntriesFromFile", () => { let tempDir: string; diff --git a/packages/coding-agent/test/session-manager/labels.test.ts b/packages/coding-agent/test/session-manager/labels.test.ts index 67a4e2991..f4d900e81 100644 --- a/packages/coding-agent/test/session-manager/labels.test.ts +++ b/packages/coding-agent/test/session-manager/labels.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { type LabelEntry, SessionManager } from "../../src/core/session-manager"; +import { type LabelEntry, SessionManager } from "$c/core/session-manager"; describe("SessionManager labels", () => { it("sets and gets labels", () => { diff --git a/packages/coding-agent/test/session-manager/migration.test.ts b/packages/coding-agent/test/session-manager/migration.test.ts index 3fb0c009b..3ea216fc0 100644 --- a/packages/coding-agent/test/session-manager/migration.test.ts +++ b/packages/coding-agent/test/session-manager/migration.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { type FileEntry, migrateSessionEntries } from "../../src/core/session-manager"; +import { type FileEntry, migrateSessionEntries } from "$c/core/session-manager"; describe("migrateSessionEntries", () => { it("should add id/parentId to v1 entries", () => { diff --git a/packages/coding-agent/test/session-manager/rewrite-tool-call.test.ts b/packages/coding-agent/test/session-manager/rewrite-tool-call.test.ts index 01cf1cf80..8cc2f4ca5 100644 --- a/packages/coding-agent/test/session-manager/rewrite-tool-call.test.ts +++ b/packages/coding-agent/test/session-manager/rewrite-tool-call.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; import type { AssistantMessage, ToolCall } from "@oh-my-pi/pi-ai"; -import { SessionManager } from "../../src/core/session-manager"; +import { SessionManager } from "$c/core/session-manager"; function buildAssistantMessage(content: AssistantMessage["content"]): AssistantMessage { return { diff --git a/packages/coding-agent/test/session-manager/save-entry.test.ts b/packages/coding-agent/test/session-manager/save-entry.test.ts index eea3b8c0c..ef1af6156 100644 --- a/packages/coding-agent/test/session-manager/save-entry.test.ts +++ b/packages/coding-agent/test/session-manager/save-entry.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { type CustomEntry, SessionManager } from "../../src/core/session-manager"; +import { type CustomEntry, SessionManager } from "$c/core/session-manager"; describe("SessionManager.saveCustomEntry", () => { it("saves custom entries and includes them in tree traversal", () => { diff --git a/packages/coding-agent/test/session-manager/tree-traversal.test.ts b/packages/coding-agent/test/session-manager/tree-traversal.test.ts index fb5f68aba..ac86dd698 100644 --- a/packages/coding-agent/test/session-manager/tree-traversal.test.ts +++ b/packages/coding-agent/test/session-manager/tree-traversal.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { type CustomEntry, SessionManager } from "../../src/core/session-manager"; +import { type CustomEntry, SessionManager } from "$c/core/session-manager"; import { assistantMsg, userMsg } from "../utilities"; describe("SessionManager append and tree traversal", () => { diff --git a/packages/coding-agent/test/settings-manager.test.ts b/packages/coding-agent/test/settings-manager.test.ts index e0a2caedb..f10f6037a 100644 --- a/packages/coding-agent/test/settings-manager.test.ts +++ b/packages/coding-agent/test/settings-manager.test.ts @@ -1,9 +1,9 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test"; import { existsSync, mkdirSync, rmSync } from "node:fs"; import { join } from "node:path"; -import { getAgentDbPath } from "../src/config"; -import { AgentStorage } from "../src/core/agent-storage"; -import { SettingsManager } from "../src/core/settings-manager"; +import { getAgentDbPath } from "$c/config"; +import { AgentStorage } from "$c/core/agent-storage"; +import { SettingsManager } from "$c/core/settings-manager"; describe("SettingsManager", () => { let testDir: string; diff --git a/packages/coding-agent/test/skills.test.ts b/packages/coding-agent/test/skills.test.ts index e7617daa5..709cd922d 100644 --- a/packages/coding-agent/test/skills.test.ts +++ b/packages/coding-agent/test/skills.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; import { homedir } from "node:os"; import { join, resolve } from "node:path"; -import { loadSkills, loadSkillsFromDir, type Skill } from "../src/core/skills"; +import { loadSkills, loadSkillsFromDir, type Skill } from "$c/core/skills"; const fixturesDir = resolve(__dirname, "fixtures/skills"); const collisionFixturesDir = resolve(__dirname, "fixtures/skills-collision"); diff --git a/packages/coding-agent/test/streaming-edit-abort.test.ts b/packages/coding-agent/test/streaming-edit-abort.test.ts index 5f10cc22e..ed6ccce1a 100644 --- a/packages/coding-agent/test/streaming-edit-abort.test.ts +++ b/packages/coding-agent/test/streaming-edit-abort.test.ts @@ -17,11 +17,11 @@ import { } from "@oh-my-pi/pi-ai"; import { Type } from "@sinclair/typebox"; import { nanoid } from "nanoid"; -import { AgentSession } from "../src/core/agent-session"; -import { AuthStorage } from "../src/core/auth-storage"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; -import { SettingsManager } from "../src/core/settings-manager"; +import { AgentSession } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; class MockAssistantStream extends EventStream { constructor() { diff --git a/packages/coding-agent/test/streaming-render-debug.ts b/packages/coding-agent/test/streaming-render-debug.ts index 7df364e26..6cc2d0f06 100644 --- a/packages/coding-agent/test/streaming-render-debug.ts +++ b/packages/coding-agent/test/streaming-render-debug.ts @@ -9,8 +9,8 @@ import { join } from "node:path"; import type { AssistantMessage } from "@oh-my-pi/pi-ai"; import { ProcessTerminal, TUI } from "@oh-my-pi/pi-tui"; import { sleep } from "bun"; -import { AssistantMessageComponent } from "../src/modes/interactive/components/assistant-message"; -import { initTheme } from "../src/modes/interactive/theme/theme"; +import { AssistantMessageComponent } from "$c/modes/interactive/components/assistant-message"; +import { initTheme } from "$c/modes/interactive/theme/theme"; // Initialize dark theme with full color support process.env.COLORTERM = "truecolor"; diff --git a/packages/coding-agent/test/system-prompt.test.ts b/packages/coding-agent/test/system-prompt.test.ts index a46e23d52..dfe62f8a8 100644 --- a/packages/coding-agent/test/system-prompt.test.ts +++ b/packages/coding-agent/test/system-prompt.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { buildSystemPrompt } from "../src/core/system-prompt"; +import { buildSystemPrompt } from "$c/core/system-prompt"; describe("buildSystemPrompt", () => { describe("empty tools", () => { diff --git a/packages/coding-agent/test/test-theme-colors.ts b/packages/coding-agent/test/test-theme-colors.ts index 5eb60e39e..cbd8f8e64 100644 --- a/packages/coding-agent/test/test-theme-colors.ts +++ b/packages/coding-agent/test/test-theme-colors.ts @@ -1,4 +1,4 @@ -import { initTheme, theme } from "../src/modes/interactive/theme/theme"; +import { initTheme, theme } from "$c/modes/interactive/theme/theme"; // Initialize with dark theme explicitly process.env.COLORTERM = "truecolor"; diff --git a/packages/coding-agent/test/tools.test.ts b/packages/coding-agent/test/tools.test.ts index 452f1cba5..1804cdec5 100644 --- a/packages/coding-agent/test/tools.test.ts +++ b/packages/coding-agent/test/tools.test.ts @@ -3,15 +3,15 @@ import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { nanoid } from "nanoid"; -import { BashTool } from "../src/core/tools/bash"; -import { FindTool } from "../src/core/tools/find"; -import { GrepTool } from "../src/core/tools/grep"; -import type { ToolSession } from "../src/core/tools/index"; -import { LsTool } from "../src/core/tools/ls"; -import { EditTool } from "../src/core/tools/patch"; -import { ReadTool } from "../src/core/tools/read"; -import { WriteTool } from "../src/core/tools/write"; -import * as shellModule from "../src/utils/shell"; +import { BashTool } from "$c/core/tools/bash"; +import { FindTool } from "$c/core/tools/find"; +import { GrepTool } from "$c/core/tools/grep"; +import type { ToolSession } from "$c/core/tools/index"; +import { LsTool } from "$c/core/tools/ls"; +import { EditTool } from "$c/core/tools/patch"; +import { ReadTool } from "$c/core/tools/read"; +import { WriteTool } from "$c/core/tools/write"; +import * as shellModule from "$c/utils/shell"; // Helper to extract text from content blocks function getTextOutput(result: any): string { diff --git a/packages/coding-agent/test/tools/index.test.ts b/packages/coding-agent/test/tools/index.test.ts index 9f23f7e37..772ee30dc 100644 --- a/packages/coding-agent/test/tools/index.test.ts +++ b/packages/coding-agent/test/tools/index.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { BUILTIN_TOOLS, createTools, HIDDEN_TOOLS, type ToolSession } from "../../src/core/tools/index"; +import { BUILTIN_TOOLS, createTools, HIDDEN_TOOLS, type ToolSession } from "$c/core/tools/index"; process.env.OMP_PYTHON_SKIP_CHECK = "1"; diff --git a/packages/coding-agent/test/tools/lsp-batching.test.ts b/packages/coding-agent/test/tools/lsp-batching.test.ts index 3749b1a6c..47caa8e92 100644 --- a/packages/coding-agent/test/tools/lsp-batching.test.ts +++ b/packages/coding-agent/test/tools/lsp-batching.test.ts @@ -1,8 +1,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "bun:test"; import { join } from "node:path"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import * as lspConfig from "../../src/core/tools/lsp/config"; -import { createLspWritethrough } from "../../src/core/tools/lsp/index"; +import * as lspConfig from "$c/core/tools/lsp/config"; +import { createLspWritethrough } from "$c/core/tools/lsp/index"; describe("createLspWritethrough batching", () => { let tempDir: ReturnType; diff --git a/packages/coding-agent/test/tools/python-execution.test.ts b/packages/coding-agent/test/tools/python-execution.test.ts index 2f6d9bde4..d864c27a2 100644 --- a/packages/coding-agent/test/tools/python-execution.test.ts +++ b/packages/coding-agent/test/tools/python-execution.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, vi } from "bun:test"; import { createTempDirSync } from "@oh-my-pi/pi-utils"; -import * as pythonExecutor from "../../src/core/python-executor"; -import type { ToolSession } from "../../src/core/tools/index"; -import { PythonTool } from "../../src/core/tools/python"; +import * as pythonExecutor from "$c/core/python-executor"; +import type { ToolSession } from "$c/core/tools/index"; +import { PythonTool } from "$c/core/tools/python"; function createSession(cwd: string): ToolSession { return { diff --git a/packages/coding-agent/test/tools/python-fallback.test.ts b/packages/coding-agent/test/tools/python-fallback.test.ts index db2b533a2..68a1eda9a 100644 --- a/packages/coding-agent/test/tools/python-fallback.test.ts +++ b/packages/coding-agent/test/tools/python-fallback.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from "bun:test"; -import * as pythonKernelModule from "../../src/core/python-kernel"; -import type { ToolSession } from "../../src/core/tools/index"; -import { createTools } from "../../src/core/tools/index"; +import * as pythonKernelModule from "$c/core/python-kernel"; +import type { ToolSession } from "$c/core/tools/index"; +import { createTools } from "$c/core/tools/index"; function createTestSession(overrides: Partial = {}): ToolSession { return { diff --git a/packages/coding-agent/test/tools/python-renderer.test.ts b/packages/coding-agent/test/tools/python-renderer.test.ts index 6630c2c7d..60d903c92 100644 --- a/packages/coding-agent/test/tools/python-renderer.test.ts +++ b/packages/coding-agent/test/tools/python-renderer.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; import stripAnsi from "strip-ansi"; -import { pythonToolRenderer } from "../../src/core/tools/python"; -import { getThemeByName } from "../../src/modes/interactive/theme/theme"; +import { pythonToolRenderer } from "$c/core/tools/python"; +import { getThemeByName } from "$c/modes/interactive/theme/theme"; describe("pythonToolRenderer", () => { it("renders truncated output when collapsed and full output when expanded", () => { diff --git a/packages/coding-agent/test/tools/python-tool-mode.test.ts b/packages/coding-agent/test/tools/python-tool-mode.test.ts index 30c613317..42c569cd8 100644 --- a/packages/coding-agent/test/tools/python-tool-mode.test.ts +++ b/packages/coding-agent/test/tools/python-tool-mode.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { createTools, type ToolSession } from "../../src/core/tools/index"; +import { createTools, type ToolSession } from "$c/core/tools/index"; function createSession(overrides: Partial = {}): ToolSession { return { diff --git a/packages/coding-agent/test/tools/python.test.ts b/packages/coding-agent/test/tools/python.test.ts index b95386988..ab9c0ec06 100644 --- a/packages/coding-agent/test/tools/python.test.ts +++ b/packages/coding-agent/test/tools/python.test.ts @@ -1,8 +1,8 @@ import { afterAll, beforeAll, describe, expect, it, vi } from "bun:test"; import { createTempDirSync, type SyncTempDir } from "@oh-my-pi/pi-utils"; -import * as pythonExecutor from "../../src/core/python-executor"; -import { createTools, type ToolSession } from "../../src/core/tools/index"; -import { PythonTool } from "../../src/core/tools/python"; +import * as pythonExecutor from "$c/core/python-executor"; +import { createTools, type ToolSession } from "$c/core/tools/index"; +import { PythonTool } from "$c/core/tools/python"; let previousSkipCheck: string | undefined; let tempDir: SyncTempDir; diff --git a/packages/coding-agent/test/tools/schema-validation.test.ts b/packages/coding-agent/test/tools/schema-validation.test.ts index 160200eff..f85294ee7 100644 --- a/packages/coding-agent/test/tools/schema-validation.test.ts +++ b/packages/coding-agent/test/tools/schema-validation.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; import { sanitizeSchemaForGoogle } from "@oh-my-pi/pi-ai"; -import { BUILTIN_TOOLS, createTools, HIDDEN_TOOLS, type ToolSession } from "../../src/core/tools/index"; +import { BUILTIN_TOOLS, createTools, HIDDEN_TOOLS, type ToolSession } from "$c/core/tools/index"; /** * Problematic JSON Schema features that cause issues with various providers. diff --git a/packages/coding-agent/test/tools/task-template.test.ts b/packages/coding-agent/test/tools/task-template.test.ts index d87762a7a..a24ab94d2 100644 --- a/packages/coding-agent/test/tools/task-template.test.ts +++ b/packages/coding-agent/test/tools/task-template.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { renderTemplate } from "../../src/core/tools/task/template"; +import { renderTemplate } from "$c/core/tools/task/template"; describe("renderTemplate", () => { test("renders explicit args", () => { diff --git a/packages/coding-agent/test/tools/web-scrapers/academic.test.ts b/packages/coding-agent/test/tools/web-scrapers/academic.test.ts index 20c217d96..6f54c23dd 100644 --- a/packages/coding-agent/test/tools/web-scrapers/academic.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/academic.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "bun:test"; -import { handleArxiv } from "../../../src/core/tools/web-scrapers/arxiv"; -import { handleIacr } from "../../../src/core/tools/web-scrapers/iacr"; -import { handlePubMed } from "../../../src/core/tools/web-scrapers/pubmed"; -import { handleSemanticScholar } from "../../../src/core/tools/web-scrapers/semantic-scholar"; +import { handleArxiv } from "$c/core/tools/web-scrapers/arxiv"; +import { handleIacr } from "$c/core/tools/web-scrapers/iacr"; +import { handlePubMed } from "$c/core/tools/web-scrapers/pubmed"; +import { handleSemanticScholar } from "$c/core/tools/web-scrapers/semantic-scholar"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/business.test.ts b/packages/coding-agent/test/tools/web-scrapers/business.test.ts index fe4255bd9..7089c0c5e 100644 --- a/packages/coding-agent/test/tools/web-scrapers/business.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/business.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { handleOpenCorporates } from "../../../src/core/tools/web-scrapers/opencorporates"; -import { handleSecEdgar } from "../../../src/core/tools/web-scrapers/sec-edgar"; +import { handleOpenCorporates } from "$c/core/tools/web-scrapers/opencorporates"; +import { handleSecEdgar } from "$c/core/tools/web-scrapers/sec-edgar"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/dev-platforms.test.ts b/packages/coding-agent/test/tools/web-scrapers/dev-platforms.test.ts index de2c9f18e..b3877431a 100644 --- a/packages/coding-agent/test/tools/web-scrapers/dev-platforms.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/dev-platforms.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "bun:test"; -import { handleDevTo } from "../../../src/core/tools/web-scrapers/devto"; -import { handleGitLab } from "../../../src/core/tools/web-scrapers/gitlab"; -import { handleHackerNews } from "../../../src/core/tools/web-scrapers/hackernews"; -import { handleLobsters } from "../../../src/core/tools/web-scrapers/lobsters"; +import { handleDevTo } from "$c/core/tools/web-scrapers/devto"; +import { handleGitLab } from "$c/core/tools/web-scrapers/gitlab"; +import { handleHackerNews } from "$c/core/tools/web-scrapers/hackernews"; +import { handleLobsters } from "$c/core/tools/web-scrapers/lobsters"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/documentation.test.ts b/packages/coding-agent/test/tools/web-scrapers/documentation.test.ts index 40a3e9af3..59353906f 100644 --- a/packages/coding-agent/test/tools/web-scrapers/documentation.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/documentation.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { handleMDN } from "../../../src/core/tools/web-scrapers/mdn"; -import { handleReadTheDocs } from "../../../src/core/tools/web-scrapers/readthedocs"; +import { handleMDN } from "$c/core/tools/web-scrapers/mdn"; +import { handleReadTheDocs } from "$c/core/tools/web-scrapers/readthedocs"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/finance-media.test.ts b/packages/coding-agent/test/tools/web-scrapers/finance-media.test.ts index 17af7a486..76c6dc585 100644 --- a/packages/coding-agent/test/tools/web-scrapers/finance-media.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/finance-media.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; -import { handleArtifactHub } from "../../../src/core/tools/web-scrapers/artifacthub"; -import { handleCoinGecko } from "../../../src/core/tools/web-scrapers/coingecko"; -import { handleDiscogs } from "../../../src/core/tools/web-scrapers/discogs"; +import { handleArtifactHub } from "$c/core/tools/web-scrapers/artifacthub"; +import { handleCoinGecko } from "$c/core/tools/web-scrapers/coingecko"; +import { handleDiscogs } from "$c/core/tools/web-scrapers/discogs"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/git-hosting.test.ts b/packages/coding-agent/test/tools/web-scrapers/git-hosting.test.ts index 2403b5b77..ba0ca683d 100644 --- a/packages/coding-agent/test/tools/web-scrapers/git-hosting.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/git-hosting.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { handleGitHub } from "../../../src/core/tools/web-scrapers/github"; -import { handleGitHubGist } from "../../../src/core/tools/web-scrapers/github-gist"; +import { handleGitHub } from "$c/core/tools/web-scrapers/github"; +import { handleGitHubGist } from "$c/core/tools/web-scrapers/github-gist"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/media.test.ts b/packages/coding-agent/test/tools/web-scrapers/media.test.ts index 862a732af..a41af3b76 100644 --- a/packages/coding-agent/test/tools/web-scrapers/media.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/media.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; -import { handleHuggingFace } from "../../../src/core/tools/web-scrapers/huggingface"; -import { handleSpotify } from "../../../src/core/tools/web-scrapers/spotify"; -import { handleVimeo } from "../../../src/core/tools/web-scrapers/vimeo"; +import { handleHuggingFace } from "$c/core/tools/web-scrapers/huggingface"; +import { handleSpotify } from "$c/core/tools/web-scrapers/spotify"; +import { handleVimeo } from "$c/core/tools/web-scrapers/vimeo"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/package-managers-2.test.ts b/packages/coding-agent/test/tools/web-scrapers/package-managers-2.test.ts index facaadd02..e88e5b5f7 100644 --- a/packages/coding-agent/test/tools/web-scrapers/package-managers-2.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/package-managers-2.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from "bun:test"; -import { handleChocolatey } from "../../../src/core/tools/web-scrapers/chocolatey"; -import { handleDockerHub } from "../../../src/core/tools/web-scrapers/dockerhub"; -import { handleHackage } from "../../../src/core/tools/web-scrapers/hackage"; -import { handleMetaCPAN } from "../../../src/core/tools/web-scrapers/metacpan"; -import { handleRepology } from "../../../src/core/tools/web-scrapers/repology"; -import { handleTerraform } from "../../../src/core/tools/web-scrapers/terraform"; +import { handleChocolatey } from "$c/core/tools/web-scrapers/chocolatey"; +import { handleDockerHub } from "$c/core/tools/web-scrapers/dockerhub"; +import { handleHackage } from "$c/core/tools/web-scrapers/hackage"; +import { handleMetaCPAN } from "$c/core/tools/web-scrapers/metacpan"; +import { handleRepology } from "$c/core/tools/web-scrapers/repology"; +import { handleTerraform } from "$c/core/tools/web-scrapers/terraform"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/package-managers.test.ts b/packages/coding-agent/test/tools/web-scrapers/package-managers.test.ts index 6a9bd9742..40527a732 100644 --- a/packages/coding-agent/test/tools/web-scrapers/package-managers.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/package-managers.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from "bun:test"; -import { handleAur } from "../../../src/core/tools/web-scrapers/aur"; -import { handleBrew } from "../../../src/core/tools/web-scrapers/brew"; -import { handleMaven } from "../../../src/core/tools/web-scrapers/maven"; -import { handleNuGet } from "../../../src/core/tools/web-scrapers/nuget"; -import { handlePackagist } from "../../../src/core/tools/web-scrapers/packagist"; -import { handleRubyGems } from "../../../src/core/tools/web-scrapers/rubygems"; +import { handleAur } from "$c/core/tools/web-scrapers/aur"; +import { handleBrew } from "$c/core/tools/web-scrapers/brew"; +import { handleMaven } from "$c/core/tools/web-scrapers/maven"; +import { handleNuGet } from "$c/core/tools/web-scrapers/nuget"; +import { handlePackagist } from "$c/core/tools/web-scrapers/packagist"; +import { handleRubyGems } from "$c/core/tools/web-scrapers/rubygems"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/package-registries.test.ts b/packages/coding-agent/test/tools/web-scrapers/package-registries.test.ts index e0276ee1f..e81ce20c4 100644 --- a/packages/coding-agent/test/tools/web-scrapers/package-registries.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/package-registries.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from "bun:test"; -import { handleCratesIo } from "../../../src/core/tools/web-scrapers/crates-io"; -import { handleGoPkg } from "../../../src/core/tools/web-scrapers/go-pkg"; -import { handleHex } from "../../../src/core/tools/web-scrapers/hex"; -import { handleNpm } from "../../../src/core/tools/web-scrapers/npm"; -import { handlePubDev } from "../../../src/core/tools/web-scrapers/pub-dev"; -import { handlePyPI } from "../../../src/core/tools/web-scrapers/pypi"; +import { handleCratesIo } from "$c/core/tools/web-scrapers/crates-io"; +import { handleGoPkg } from "$c/core/tools/web-scrapers/go-pkg"; +import { handleHex } from "$c/core/tools/web-scrapers/hex"; +import { handleNpm } from "$c/core/tools/web-scrapers/npm"; +import { handlePubDev } from "$c/core/tools/web-scrapers/pub-dev"; +import { handlePyPI } from "$c/core/tools/web-scrapers/pypi"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/research.test.ts b/packages/coding-agent/test/tools/web-scrapers/research.test.ts index 77b3a1ed9..9fed4ebd8 100644 --- a/packages/coding-agent/test/tools/web-scrapers/research.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/research.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; -import { handleBiorxiv } from "../../../src/core/tools/web-scrapers/biorxiv"; -import { handleOpenLibrary } from "../../../src/core/tools/web-scrapers/openlibrary"; -import { handleWikidata } from "../../../src/core/tools/web-scrapers/wikidata"; +import { handleBiorxiv } from "$c/core/tools/web-scrapers/biorxiv"; +import { handleOpenLibrary } from "$c/core/tools/web-scrapers/openlibrary"; +import { handleWikidata } from "$c/core/tools/web-scrapers/wikidata"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/security.test.ts b/packages/coding-agent/test/tools/web-scrapers/security.test.ts index d8db1bf6d..5559553a4 100644 --- a/packages/coding-agent/test/tools/web-scrapers/security.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/security.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { handleNvd } from "../../../src/core/tools/web-scrapers/nvd"; -import { handleOsv } from "../../../src/core/tools/web-scrapers/osv"; +import { handleNvd } from "$c/core/tools/web-scrapers/nvd"; +import { handleOsv } from "$c/core/tools/web-scrapers/osv"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/social-extended.test.ts b/packages/coding-agent/test/tools/web-scrapers/social-extended.test.ts index 8964c2cd9..a476c3477 100644 --- a/packages/coding-agent/test/tools/web-scrapers/social-extended.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/social-extended.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; -import { handleBluesky } from "../../../src/core/tools/web-scrapers/bluesky"; -import { handleMastodon } from "../../../src/core/tools/web-scrapers/mastodon"; +import { handleBluesky } from "$c/core/tools/web-scrapers/bluesky"; +import { handleMastodon } from "$c/core/tools/web-scrapers/mastodon"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/social.test.ts b/packages/coding-agent/test/tools/web-scrapers/social.test.ts index 54c40ff93..cbf257b04 100644 --- a/packages/coding-agent/test/tools/web-scrapers/social.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/social.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; -import { handleReddit } from "../../../src/core/tools/web-scrapers/reddit"; -import { handleStackOverflow } from "../../../src/core/tools/web-scrapers/stackoverflow"; -import { handleTwitter } from "../../../src/core/tools/web-scrapers/twitter"; +import { handleReddit } from "$c/core/tools/web-scrapers/reddit"; +import { handleStackOverflow } from "$c/core/tools/web-scrapers/stackoverflow"; +import { handleTwitter } from "$c/core/tools/web-scrapers/twitter"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/stackexchange.test.ts b/packages/coding-agent/test/tools/web-scrapers/stackexchange.test.ts index 1ce3b6ec2..0ea8347fa 100644 --- a/packages/coding-agent/test/tools/web-scrapers/stackexchange.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/stackexchange.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { handleStackOverflow } from "../../../src/core/tools/web-scrapers/stackoverflow"; +import { handleStackOverflow } from "$c/core/tools/web-scrapers/stackoverflow"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/standards.test.ts b/packages/coding-agent/test/tools/web-scrapers/standards.test.ts index e49c3ddf5..c60b17c96 100644 --- a/packages/coding-agent/test/tools/web-scrapers/standards.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/standards.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; -import { handleCheatSh } from "../../../src/core/tools/web-scrapers/cheatsh"; -import { handleRfc } from "../../../src/core/tools/web-scrapers/rfc"; -import { handleTldr } from "../../../src/core/tools/web-scrapers/tldr"; +import { handleCheatSh } from "$c/core/tools/web-scrapers/cheatsh"; +import { handleRfc } from "$c/core/tools/web-scrapers/rfc"; +import { handleTldr } from "$c/core/tools/web-scrapers/tldr"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/wikipedia.test.ts b/packages/coding-agent/test/tools/web-scrapers/wikipedia.test.ts index 04eeb9f54..2672ce91f 100644 --- a/packages/coding-agent/test/tools/web-scrapers/wikipedia.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/wikipedia.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { handleWikipedia } from "../../../src/core/tools/web-scrapers/wikipedia"; +import { handleWikipedia } from "$c/core/tools/web-scrapers/wikipedia"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/tools/web-scrapers/youtube.test.ts b/packages/coding-agent/test/tools/web-scrapers/youtube.test.ts index 4877e0720..49e7773fe 100644 --- a/packages/coding-agent/test/tools/web-scrapers/youtube.test.ts +++ b/packages/coding-agent/test/tools/web-scrapers/youtube.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { handleYouTube } from "../../../src/core/tools/web-scrapers/youtube"; +import { handleYouTube } from "$c/core/tools/web-scrapers/youtube"; const SKIP = !process.env.WEB_FETCH_INTEGRATION; diff --git a/packages/coding-agent/test/utilities.ts b/packages/coding-agent/test/utilities.ts index 71cc7f345..fa2d77091 100644 --- a/packages/coding-agent/test/utilities.ts +++ b/packages/coding-agent/test/utilities.ts @@ -8,12 +8,12 @@ import { join } from "node:path"; import { Agent } from "@oh-my-pi/pi-agent-core"; import { getModel } from "@oh-my-pi/pi-ai"; import { nanoid } from "nanoid"; -import { AgentSession } from "../src/core/agent-session"; -import { AuthStorage } from "../src/core/auth-storage"; -import { ModelRegistry } from "../src/core/model-registry"; -import { SessionManager } from "../src/core/session-manager"; -import { SettingsManager } from "../src/core/settings-manager"; -import { createTools, type ToolSession } from "../src/core/tools/index"; +import { AgentSession } from "$c/core/agent-session"; +import { AuthStorage } from "$c/core/auth-storage"; +import { ModelRegistry } from "$c/core/model-registry"; +import { SessionManager } from "$c/core/session-manager"; +import { SettingsManager } from "$c/core/settings-manager"; +import { createTools, type ToolSession } from "$c/core/tools/index"; /** * API key for authenticated tests. Tests using this should be wrapped in diff --git a/packages/coding-agent/tsconfig.check.json b/packages/coding-agent/tsconfig.check.json index 52dfa54af..126064a0d 100644 --- a/packages/coding-agent/tsconfig.check.json +++ b/packages/coding-agent/tsconfig.check.json @@ -1,8 +1,5 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "noEmit": true - }, + "extends": "../../tsconfig.json", "include": ["src/**/*.ts", "test/**/*.ts", "src/bun-imports.d.ts"], "exclude": ["node_modules", "dist"] } diff --git a/packages/coding-agent/tsconfig.json b/packages/coding-agent/tsconfig.json index d8356ca6f..2d65796f1 100644 --- a/packages/coding-agent/tsconfig.json +++ b/packages/coding-agent/tsconfig.json @@ -1,7 +1,28 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "noEmit": true + "noEmit": true, + "baseUrl": ".", + "paths": { + "$c/*": ["./src/*"], + "$ai/*": ["../ai/src/*"], + "$tui/*": ["../tui/src/*"], + "$agent/*": ["../agent/src/*"], + "$stats/*": ["../omp-stats/src/*"], + "@oh-my-pi/pi-ai": ["../ai/src/index.ts"], + "@oh-my-pi/pi-ai/*": ["../ai/src/*"], + "@oh-my-pi/pi-agent-core": ["../agent/src/index.ts"], + "@oh-my-pi/pi-agent-core/*": ["../agent/src/*"], + "@oh-my-pi/pi-utils": ["../pi-utils/src/index.ts"], + "@oh-my-pi/pi-utils/*": ["../pi-utils/src/*"], + "@oh-my-pi/pi-coding-agent": ["./src/index.ts"], + "@oh-my-pi/pi-coding-agent/hooks": ["./src/core/hooks/index.ts"], + "@oh-my-pi/pi-coding-agent/*": ["./src/*"], + "@oh-my-pi/pi-tui": ["../tui/src/index.ts"], + "@oh-my-pi/pi-tui/*": ["../tui/src/*"], + "@oh-my-pi/pi-mom": ["../mom/src/index.ts"], + "@oh-my-pi/pi-mom/*": ["../mom/src/*"] + } }, "include": ["src/**/*.ts", "src/bun-imports.d.ts"], "exclude": ["node_modules", "dist", "**/*.test.ts", "test/**"] diff --git a/packages/omp-stats/tsconfig.json b/packages/omp-stats/tsconfig.json index b87dea25d..a4f1509c6 100644 --- a/packages/omp-stats/tsconfig.json +++ b/packages/omp-stats/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.json", "compilerOptions": { "noEmit": true }, diff --git a/packages/tui/src/components/box.ts b/packages/tui/src/components/box.ts index da11eaa5e..f0214df63 100644 --- a/packages/tui/src/components/box.ts +++ b/packages/tui/src/components/box.ts @@ -1,5 +1,5 @@ -import type { Component } from "../tui"; -import { applyBackgroundToLine, visibleWidth } from "../utils"; +import type { Component } from "$tui/tui"; +import { applyBackgroundToLine, visibleWidth } from "$tui/utils"; /** * Box component - a container that applies padding and background to all children diff --git a/packages/tui/src/components/cancellable-loader.ts b/packages/tui/src/components/cancellable-loader.ts index ec16447ae..2e23b64fe 100644 --- a/packages/tui/src/components/cancellable-loader.ts +++ b/packages/tui/src/components/cancellable-loader.ts @@ -1,4 +1,4 @@ -import { matchesKey } from "../keys"; +import { matchesKey } from "$tui/keys"; import { Loader } from "./loader"; /** diff --git a/packages/tui/src/components/editor.ts b/packages/tui/src/components/editor.ts index 58ca3112a..52cc34950 100644 --- a/packages/tui/src/components/editor.ts +++ b/packages/tui/src/components/editor.ts @@ -1,8 +1,8 @@ -import type { AutocompleteProvider, CombinedAutocompleteProvider } from "../autocomplete"; -import { matchesKey } from "../keys"; -import type { SymbolTheme } from "../symbols"; -import { type Component, CURSOR_MARKER, type Focusable } from "../tui"; -import { getSegmenter, isPunctuationChar, isWhitespaceChar, truncateToWidth, visibleWidth } from "../utils"; +import type { AutocompleteProvider, CombinedAutocompleteProvider } from "$tui/autocomplete"; +import { matchesKey } from "$tui/keys"; +import type { SymbolTheme } from "$tui/symbols"; +import { type Component, CURSOR_MARKER, type Focusable } from "$tui/tui"; +import { getSegmenter, isPunctuationChar, isWhitespaceChar, truncateToWidth, visibleWidth } from "$tui/utils"; import { SelectList, type SelectListTheme } from "./select-list"; const segmenter = getSegmenter(); diff --git a/packages/tui/src/components/image.ts b/packages/tui/src/components/image.ts index 7676fb8b8..e1c4d0754 100644 --- a/packages/tui/src/components/image.ts +++ b/packages/tui/src/components/image.ts @@ -4,8 +4,8 @@ import { type ImageDimensions, imageFallback, renderImage, -} from "../terminal-image"; -import type { Component } from "../tui"; +} from "$tui/terminal-image"; +import type { Component } from "$tui/tui"; export interface ImageTheme { fallbackColor: (str: string) => string; diff --git a/packages/tui/src/components/input.ts b/packages/tui/src/components/input.ts index e029277b9..be05fb16e 100644 --- a/packages/tui/src/components/input.ts +++ b/packages/tui/src/components/input.ts @@ -1,6 +1,6 @@ -import { getEditorKeybindings } from "../keybindings"; -import { type Component, CURSOR_MARKER, type Focusable } from "../tui"; -import { getSegmenter, isPunctuationChar, isWhitespaceChar, visibleWidth } from "../utils"; +import { getEditorKeybindings } from "$tui/keybindings"; +import { type Component, CURSOR_MARKER, type Focusable } from "$tui/tui"; +import { getSegmenter, isPunctuationChar, isWhitespaceChar, visibleWidth } from "$tui/utils"; const segmenter = getSegmenter(); diff --git a/packages/tui/src/components/loader.ts b/packages/tui/src/components/loader.ts index 42a20f009..806b1340f 100644 --- a/packages/tui/src/components/loader.ts +++ b/packages/tui/src/components/loader.ts @@ -1,4 +1,4 @@ -import type { TUI } from "../tui"; +import type { TUI } from "$tui/tui"; import { Text } from "./text"; /** diff --git a/packages/tui/src/components/markdown.ts b/packages/tui/src/components/markdown.ts index f2d0ba3d7..770c08f98 100644 --- a/packages/tui/src/components/markdown.ts +++ b/packages/tui/src/components/markdown.ts @@ -1,7 +1,7 @@ import { marked, type Token } from "marked"; -import type { SymbolTheme } from "../symbols"; -import type { Component } from "../tui"; -import { applyBackgroundToLine, visibleWidth, wrapTextWithAnsi } from "../utils"; +import type { SymbolTheme } from "$tui/symbols"; +import type { Component } from "$tui/tui"; +import { applyBackgroundToLine, visibleWidth, wrapTextWithAnsi } from "$tui/utils"; /** * Default text styling for markdown content. diff --git a/packages/tui/src/components/select-list.ts b/packages/tui/src/components/select-list.ts index bf5ed4e05..9fbeecb27 100644 --- a/packages/tui/src/components/select-list.ts +++ b/packages/tui/src/components/select-list.ts @@ -1,7 +1,7 @@ -import { matchesKey } from "../keys"; -import type { SymbolTheme } from "../symbols"; -import type { Component } from "../tui"; -import { truncateToWidth, visibleWidth } from "../utils"; +import { matchesKey } from "$tui/keys"; +import type { SymbolTheme } from "$tui/symbols"; +import type { Component } from "$tui/tui"; +import { truncateToWidth, visibleWidth } from "$tui/utils"; export interface SelectItem { value: string; diff --git a/packages/tui/src/components/settings-list.ts b/packages/tui/src/components/settings-list.ts index f12f9122c..5b3ae418f 100644 --- a/packages/tui/src/components/settings-list.ts +++ b/packages/tui/src/components/settings-list.ts @@ -1,6 +1,6 @@ -import { matchesKey } from "../keys"; -import type { Component } from "../tui"; -import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "../utils"; +import { matchesKey } from "$tui/keys"; +import type { Component } from "$tui/tui"; +import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "$tui/utils"; export interface SettingItem { /** Unique identifier for this setting */ diff --git a/packages/tui/src/components/spacer.ts b/packages/tui/src/components/spacer.ts index ce21920ae..c2df10466 100644 --- a/packages/tui/src/components/spacer.ts +++ b/packages/tui/src/components/spacer.ts @@ -1,4 +1,4 @@ -import type { Component } from "../tui"; +import type { Component } from "$tui/tui"; /** * Spacer component that renders empty lines diff --git a/packages/tui/src/components/tab-bar.ts b/packages/tui/src/components/tab-bar.ts index e85c25f5c..61ee9248a 100644 --- a/packages/tui/src/components/tab-bar.ts +++ b/packages/tui/src/components/tab-bar.ts @@ -9,9 +9,9 @@ * - Shift+Tab / Arrow Left: Previous tab (wraps around) */ -import { matchesKey } from "../keys"; -import type { Component } from "../tui"; -import { wrapTextWithAnsi } from "../utils"; +import { matchesKey } from "$tui/keys"; +import type { Component } from "$tui/tui"; +import { wrapTextWithAnsi } from "$tui/utils"; /** Tab definition */ export interface Tab { diff --git a/packages/tui/src/components/text.ts b/packages/tui/src/components/text.ts index baa1d9bb1..da9b81966 100644 --- a/packages/tui/src/components/text.ts +++ b/packages/tui/src/components/text.ts @@ -1,5 +1,5 @@ -import type { Component } from "../tui"; -import { applyBackgroundToLine, wrapTextWithAnsi } from "../utils"; +import type { Component } from "$tui/tui"; +import { applyBackgroundToLine, wrapTextWithAnsi } from "$tui/utils"; /** * Text component - displays multi-line text with word wrapping diff --git a/packages/tui/src/components/truncated-text.ts b/packages/tui/src/components/truncated-text.ts index 861306e9f..91d4e3428 100644 --- a/packages/tui/src/components/truncated-text.ts +++ b/packages/tui/src/components/truncated-text.ts @@ -1,5 +1,5 @@ -import type { Component } from "../tui"; -import { truncateToWidth } from "../utils"; +import type { Component } from "$tui/tui"; +import { truncateToWidth } from "$tui/utils"; /** * Text component that truncates to fit viewport width diff --git a/packages/tui/test/autocomplete.test.ts b/packages/tui/test/autocomplete.test.ts index b30a7c545..c1e6ed0f9 100644 --- a/packages/tui/test/autocomplete.test.ts +++ b/packages/tui/test/autocomplete.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { CombinedAutocompleteProvider } from "../src/autocomplete"; +import { CombinedAutocompleteProvider } from "$tui/autocomplete"; describe("CombinedAutocompleteProvider", () => { describe("extractPathPrefix", () => { diff --git a/packages/tui/test/chat-simple.ts b/packages/tui/test/chat-simple.ts index d5714197a..c1a80b4c3 100644 --- a/packages/tui/test/chat-simple.ts +++ b/packages/tui/test/chat-simple.ts @@ -3,13 +3,13 @@ */ import chalk from "chalk"; -import { CombinedAutocompleteProvider } from "../src/autocomplete"; -import { Editor } from "../src/components/editor"; -import { Loader } from "../src/components/loader"; -import { Markdown } from "../src/components/markdown"; -import { Text } from "../src/components/text"; -import { ProcessTerminal } from "../src/terminal"; -import { TUI } from "../src/tui"; +import { CombinedAutocompleteProvider } from "$tui/autocomplete"; +import { Editor } from "$tui/components/editor"; +import { Loader } from "$tui/components/loader"; +import { Markdown } from "$tui/components/markdown"; +import { Text } from "$tui/components/text"; +import { ProcessTerminal } from "$tui/terminal"; +import { TUI } from "$tui/tui"; import { defaultEditorTheme, defaultMarkdownTheme } from "./test-themes"; // Create terminal diff --git a/packages/tui/test/editor.test.ts b/packages/tui/test/editor.test.ts index 9efaddec5..29611040e 100644 --- a/packages/tui/test/editor.test.ts +++ b/packages/tui/test/editor.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; import { stripVTControlCharacters } from "node:util"; -import { Editor } from "../src/components/editor"; -import { visibleWidth } from "../src/utils"; +import { Editor } from "$tui/components/editor"; +import { visibleWidth } from "$tui/utils"; import { defaultEditorTheme } from "./test-themes"; describe("Editor component", () => { diff --git a/packages/tui/test/image-test.ts b/packages/tui/test/image-test.ts index 82a04fda9..e0459826e 100644 --- a/packages/tui/test/image-test.ts +++ b/packages/tui/test/image-test.ts @@ -1,9 +1,9 @@ -import { Image } from "../src/components/image"; -import { Spacer } from "../src/components/spacer"; -import { Text } from "../src/components/text"; -import { ProcessTerminal } from "../src/terminal"; -import { getCapabilities, getImageDimensions } from "../src/terminal-image"; -import { TUI } from "../src/tui"; +import { Image } from "$tui/components/image"; +import { Spacer } from "$tui/components/spacer"; +import { Text } from "$tui/components/text"; +import { ProcessTerminal } from "$tui/terminal"; +import { getCapabilities, getImageDimensions } from "$tui/terminal-image"; +import { TUI } from "$tui/tui"; const testImagePath = Bun.argv[2] || "/tmp/test-image.png"; diff --git a/packages/tui/test/key-tester.ts b/packages/tui/test/key-tester.ts index 71b45c0c2..05db1521e 100755 --- a/packages/tui/test/key-tester.ts +++ b/packages/tui/test/key-tester.ts @@ -1,7 +1,7 @@ #!/usr/bin/env bun -import { matchesKey } from "../src/keys"; -import { ProcessTerminal } from "../src/terminal"; -import { type Component, TUI } from "../src/tui"; +import { matchesKey } from "$tui/keys"; +import { ProcessTerminal } from "$tui/terminal"; +import { type Component, TUI } from "$tui/tui"; /** * Simple key code logger component diff --git a/packages/tui/test/markdown.test.ts b/packages/tui/test/markdown.test.ts index 69d00fac8..3ae6e3f10 100644 --- a/packages/tui/test/markdown.test.ts +++ b/packages/tui/test/markdown.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "bun:test"; import { Chalk } from "chalk"; -import { Markdown } from "../src/components/markdown"; +import { Markdown } from "$tui/components/markdown"; import { defaultMarkdownTheme } from "./test-themes"; // Force full color in CI so ANSI assertions are deterministic diff --git a/packages/tui/test/stdin-buffer.test.ts b/packages/tui/test/stdin-buffer.test.ts index edcee9a05..3e463b794 100644 --- a/packages/tui/test/stdin-buffer.test.ts +++ b/packages/tui/test/stdin-buffer.test.ts @@ -6,7 +6,7 @@ */ import { beforeEach, describe, expect, it } from "bun:test"; -import { StdinBuffer } from "../src/stdin-buffer"; +import { StdinBuffer } from "$tui/stdin-buffer"; describe("StdinBuffer", () => { let buffer: StdinBuffer; diff --git a/packages/tui/test/test-themes.ts b/packages/tui/test/test-themes.ts index d0c2b0faf..be9d1d729 100644 --- a/packages/tui/test/test-themes.ts +++ b/packages/tui/test/test-themes.ts @@ -3,7 +3,7 @@ */ import { Chalk } from "chalk"; -import type { EditorTheme, MarkdownTheme, SelectListTheme, SymbolTheme } from "../src/index"; +import type { EditorTheme, MarkdownTheme, SelectListTheme, SymbolTheme } from "$tui/index"; const chalk = new Chalk({ level: 3 }); diff --git a/packages/tui/test/truncated-text.test.ts b/packages/tui/test/truncated-text.test.ts index d0a8ed1b4..98d11f368 100644 --- a/packages/tui/test/truncated-text.test.ts +++ b/packages/tui/test/truncated-text.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "bun:test"; import { Chalk } from "chalk"; -import { TruncatedText } from "../src/components/truncated-text"; -import { visibleWidth } from "../src/utils"; +import { TruncatedText } from "$tui/components/truncated-text"; +import { visibleWidth } from "$tui/utils"; // Force full color in CI so ANSI assertions are deterministic const chalk = new Chalk({ level: 3 }); diff --git a/packages/tui/test/virtual-terminal.ts b/packages/tui/test/virtual-terminal.ts index ed29e93c8..d423e1e6d 100644 --- a/packages/tui/test/virtual-terminal.ts +++ b/packages/tui/test/virtual-terminal.ts @@ -1,6 +1,6 @@ import type { Terminal as XtermTerminalType } from "@xterm/headless"; import xterm from "@xterm/headless"; -import type { Terminal } from "../src/terminal"; +import type { Terminal } from "$tui/terminal"; // Extract Terminal class from the module const XtermTerminal = xterm.Terminal; diff --git a/packages/tui/test/wrap-ansi.test.ts b/packages/tui/test/wrap-ansi.test.ts index 5ee639656..4641fb2ae 100644 --- a/packages/tui/test/wrap-ansi.test.ts +++ b/packages/tui/test/wrap-ansi.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { visibleWidth, wrapTextWithAnsi } from "../src/utils"; +import { visibleWidth, wrapTextWithAnsi } from "$tui/utils"; describe("wrapTextWithAnsi", () => { describe("underline styling", () => { diff --git a/packages/tui/tsconfig.json b/packages/tui/tsconfig.json new file mode 100644 index 000000000..309e8d712 --- /dev/null +++ b/packages/tui/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "baseUrl": ".", + "paths": { + "$tui/*": ["./src/*"], + "$ai/*": ["../ai/src/*"], + "$c/*": ["../coding-agent/src/*"], + "$agent/*": ["../agent/src/*"], + "$stats/*": ["../omp-stats/src/*"], + "@oh-my-pi/pi-tui": ["./src/index.ts"], + "@oh-my-pi/pi-tui/*": ["./src/*"], + "@oh-my-pi/pi-ai": ["../ai/src/index.ts"], + "@oh-my-pi/pi-ai/*": ["../ai/src/*"], + "@oh-my-pi/pi-agent-core": ["../agent/src/index.ts"], + "@oh-my-pi/pi-agent-core/*": ["../agent/src/*"], + "@oh-my-pi/pi-utils": ["../pi-utils/src/index.ts"], + "@oh-my-pi/pi-utils/*": ["../pi-utils/src/*"], + "@oh-my-pi/pi-coding-agent": ["../coding-agent/src/index.ts"], + "@oh-my-pi/pi-coding-agent/*": ["../coding-agent/src/*"] + } + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/scripts/transform-imports.ts b/scripts/transform-imports.ts new file mode 100644 index 000000000..eb7dd9077 --- /dev/null +++ b/scripts/transform-imports.ts @@ -0,0 +1,91 @@ +#!/usr/bin/env bun +import { readFileSync, writeFileSync } from "node:fs"; +import { dirname, relative, resolve } from "node:path"; +import { Glob } from "bun"; + +const PACKAGES: Record = { + "coding-agent": "$c", + ai: "$ai", + tui: "$tui", + agent: "$agent", + "omp-stats": "$stats", +}; + +const ROOT = resolve(import.meta.dirname, ".."); + +async function transformFile(filePath: string, pkgName: string, prefix: string): Promise { + const content = readFileSync(filePath, "utf-8"); + const pkgRoot = resolve(ROOT, "packages", pkgName); + const srcRoot = resolve(pkgRoot, "src"); + const fileDir = dirname(filePath); + + let transformed = content; + let count = 0; + + // Match import/export from with relative paths starting with ../ + const importRegex = /(from\s+["'])(\.\.[^"']+)(["'])/g; + + transformed = content.replace(importRegex, (match, before, importPath, after) => { + // Resolve the relative import to absolute + const absolutePath = resolve(fileDir, importPath); + + // Check if it resolves within src/ + if (!absolutePath.startsWith(srcRoot)) { + return match; // Outside src, keep as-is + } + + // Get path relative to src/ + let relToSrc = relative(srcRoot, absolutePath); + + // Handle index imports - if pointing to a directory, it's importing index + // But we keep the path as-is since TS resolves index automatically + + const newImport = `${prefix}/${relToSrc}`; + count++; + return `${before}${newImport}${after}`; + }); + + if (count > 0) { + writeFileSync(filePath, transformed); + } + + return count; +} + +async function transformPackage(pkgName: string, prefix: string): Promise { + const pkgRoot = resolve(ROOT, "packages", pkgName); + const glob = new Glob("**/*.ts"); + let total = 0; + + for await (const file of glob.scan({ cwd: resolve(pkgRoot, "src"), absolute: true })) { + total += await transformFile(file, pkgName, prefix); + } + + // Also transform test files if directory exists + const testDir = resolve(pkgRoot, "test"); + try { + const testGlob = new Glob("**/*.ts"); + for await (const file of testGlob.scan({ cwd: testDir, absolute: true })) { + total += await transformFile(file, pkgName, prefix); + } + } catch { + // test dir doesn't exist, skip + } + + return total; +} + +async function main() { + console.log("Transforming relative imports to path aliases...\n"); + + let grandTotal = 0; + for (const [pkgName, prefix] of Object.entries(PACKAGES)) { + const count = await transformPackage(pkgName, prefix); + console.log(` ${pkgName}: ${count} imports transformed`); + grandTotal += count; + } + + console.log(`\nTotal: ${grandTotal} imports transformed`); +} + +main().catch(console.error); diff --git a/tsconfig.json b/tsconfig.json index 93e4be9ed..04cbedf99 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,11 @@ "compilerOptions": { "noEmit": true, "paths": { + "$c/*": ["./packages/coding-agent/src/*"], + "$ai/*": ["./packages/ai/src/*"], + "$tui/*": ["./packages/tui/src/*"], + "$agent/*": ["./packages/agent/src/*"], + "$stats/*": ["./packages/omp-stats/src/*"], "*": ["./*"], "@oh-my-pi/pi-ai": ["./packages/ai/src/index.ts"], "@oh-my-pi/pi-ai/*": ["./packages/ai/src/*"], @@ -14,14 +19,8 @@ "@oh-my-pi/pi-coding-agent/hooks": ["./packages/coding-agent/src/core/hooks/index.ts"], "@oh-my-pi/pi-coding-agent/*": ["./packages/coding-agent/src/*"], "@sinclair/typebox": ["./node_modules/@sinclair/typebox"], - "@oh-my-pi/pi-mom": ["./packages/mom/src/index.ts"], - "@oh-my-pi/pi-mom/*": ["./packages/mom/src/*"], "@oh-my-pi/pi-tui": ["./packages/tui/src/index.ts"], - "@oh-my-pi/pi-tui/*": ["./packages/tui/src/*"], - "@oh-my-pi/pi-web-ui": ["./packages/web-ui/src/index.ts"], - "@oh-my-pi/pi-web-ui/*": ["./packages/web-ui/src/*"], - "@oh-my-pi/pi-agent-old": ["./packages/agent-old/src/index.ts"], - "@oh-my-pi/pi-agent-old/*": ["./packages/agent-old/src/*"] + "@oh-my-pi/pi-tui/*": ["./packages/tui/src/*"] } }, "include": ["packages/*/src/**/*", "packages/*/test/**/*", "packages/coding-agent/examples/**/*"],