@@ -5,7 +5,7 @@ import { type Effort, THINKING_EFFORTS } from "@oh-my-pi/pi-ai";
|
||||
import { APP_NAME, CONFIG_DIR_NAME, logger } from "@oh-my-pi/pi-utils";
|
||||
import chalk from "chalk";
|
||||
import { parseEffort } from "../thinking";
|
||||
import { BUILTIN_TOOLS, resolveToolAlias } from "../tools";
|
||||
import { BUILTIN_TOOLS } from "../tools";
|
||||
|
||||
export type Mode = "text" | "json" | "rpc" | "acp";
|
||||
|
||||
@@ -129,8 +129,7 @@ export function parseArgs(args: string[], extensionFlags?: Map<string, { type: "
|
||||
.map(s => s.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
const validTools: string[] = [];
|
||||
for (const rawName of toolNames) {
|
||||
const name = resolveToolAlias(rawName);
|
||||
for (const name of toolNames) {
|
||||
if (name in BUILTIN_TOOLS) {
|
||||
validTools.push(name);
|
||||
} else {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { formatChunkedRead, resolveAnchorStyle } from "../edit/modes/chunk";
|
||||
import { getLanguageFromPath } from "../modes/theme/theme";
|
||||
import type { ToolSession } from "../tools";
|
||||
import { parseReadUrlTarget } from "../tools/fetch";
|
||||
import { OpenTool } from "../tools/open";
|
||||
import { ReadTool } from "../tools/read";
|
||||
|
||||
export interface ReadCommandArgs {
|
||||
path: string;
|
||||
@@ -34,7 +34,7 @@ export async function runReadCommand(cmd: ReadCommandArgs): Promise<void> {
|
||||
const parsedUrlTarget = parseReadUrlTarget(cmd.path, cmd.sel);
|
||||
if (parsedUrlTarget) {
|
||||
const settings = await Settings.init({ cwd });
|
||||
const tool = new OpenTool(createCliReadSession(cwd, settings));
|
||||
const tool = new ReadTool(createCliReadSession(cwd, settings));
|
||||
const result = await tool.execute("cli-read", { path: cmd.path, sel: cmd.sel });
|
||||
const text = result.content.find((content): content is { type: "text"; text: string } => content.type === "text");
|
||||
console.log(text?.text ?? "");
|
||||
|
||||
Reference in New Issue
Block a user