From 76f08dd7d3d3537238c4e5cf7828987182224368 Mon Sep 17 00:00:00 2001 From: can1357 Date: Sat, 6 Jun 2026 22:58:33 +0200 Subject: [PATCH] refactor(packages/coding-agent): migrated imports to pi-ai submodules - Migrated Effort and THINKING_EFFORTS imports to @oh-my-pi/pi-ai/effort in CLI args and launch command files. - Split model-registry dependencies across focused @oh-my-pi/pi-ai submodules instead of the root barrel export. --- packages/coding-agent/src/cli/args.ts | 2 +- packages/coding-agent/src/commands/launch.ts | 2 +- .../coding-agent/src/config/model-registry.ts | 24 +++++++------------ 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/packages/coding-agent/src/cli/args.ts b/packages/coding-agent/src/cli/args.ts index 0f770c0ce..707d87c54 100644 --- a/packages/coding-agent/src/cli/args.ts +++ b/packages/coding-agent/src/cli/args.ts @@ -1,7 +1,7 @@ /** * CLI argument parsing and help display */ -import { type Effort, THINKING_EFFORTS } from "@oh-my-pi/pi-ai"; +import { type Effort, THINKING_EFFORTS } from "@oh-my-pi/pi-ai/effort"; import { APP_NAME, CONFIG_DIR_NAME, logger } from "@oh-my-pi/pi-utils"; import chalk from "chalk"; import { parseEffort } from "../thinking"; diff --git a/packages/coding-agent/src/commands/launch.ts b/packages/coding-agent/src/commands/launch.ts index a752cdf82..d26dc543a 100644 --- a/packages/coding-agent/src/commands/launch.ts +++ b/packages/coding-agent/src/commands/launch.ts @@ -2,7 +2,7 @@ * Root command for the coding agent CLI. */ -import { THINKING_EFFORTS } from "@oh-my-pi/pi-ai"; +import { THINKING_EFFORTS } from "@oh-my-pi/pi-ai/effort"; import { APP_NAME } from "@oh-my-pi/pi-utils"; import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli"; import { parseArgs } from "../cli/args"; diff --git a/packages/coding-agent/src/config/model-registry.ts b/packages/coding-agent/src/config/model-registry.ts index ac83a06ce..eb35413e1 100644 --- a/packages/coding-agent/src/config/model-registry.ts +++ b/packages/coding-agent/src/config/model-registry.ts @@ -1,27 +1,19 @@ import * as path from "node:path"; +import { registerCustomApi, unregisterCustomApis } from "@oh-my-pi/pi-ai/api-registry"; +import { readModelCache } from "@oh-my-pi/pi-ai/model-cache"; +import { createModelManager, type ModelManagerOptions, type ModelRefreshStrategy } from "@oh-my-pi/pi-ai/model-manager"; +import { enrichModelThinking } from "@oh-my-pi/pi-ai/model-thinking"; +import { getBundledModels, getBundledProviders } from "@oh-my-pi/pi-ai/models"; import { - type Api, - type AssistantMessageEventStream, - type Context, - createModelManager, - enrichModelThinking, - getBundledModels, - getBundledProviders, googleAntigravityModelManagerOptions, googleGeminiCliModelManagerOptions, - type Model, - type ModelManagerOptions, - type ModelRefreshStrategy, openaiCodexModelManagerOptions, PROVIDER_DESCRIPTORS, - readModelCache, - registerCustomApi, - type SimpleStreamOptions, - type ThinkingConfig, UNK_CONTEXT_WINDOW, UNK_MAX_TOKENS, - unregisterCustomApis, -} from "@oh-my-pi/pi-ai"; +} from "@oh-my-pi/pi-ai/provider-models"; +import type { Api, Context, Model, SimpleStreamOptions, ThinkingConfig } from "@oh-my-pi/pi-ai/types"; +import type { AssistantMessageEventStream } from "@oh-my-pi/pi-ai/utils/event-stream"; // Sentinel for local-only OAuth token (LM Studio, vLLM) — declared inline to avoid loading // any provider module at startup. Must match `DEFAULT_LOCAL_TOKEN` in oauth/lm-studio.ts.