fix run command to be less messy
This commit is contained in:
@@ -84,10 +84,6 @@ export const RunCommand = cmd({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
UI.empty()
|
|
||||||
UI.println(UI.logo())
|
|
||||||
UI.empty()
|
|
||||||
|
|
||||||
const cfg = await Config.get()
|
const cfg = await Config.get()
|
||||||
if (cfg.share === "auto" || Flag.OPENCODE_AUTO_SHARE || args.share) {
|
if (cfg.share === "auto" || Flag.OPENCODE_AUTO_SHARE || args.share) {
|
||||||
try {
|
try {
|
||||||
@@ -101,7 +97,6 @@ export const RunCommand = cmd({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UI.empty()
|
|
||||||
|
|
||||||
const agent = await (async () => {
|
const agent = await (async () => {
|
||||||
if (args.agent) return Agent.get(args.agent)
|
if (args.agent) return Agent.get(args.agent)
|
||||||
@@ -116,9 +111,6 @@ export const RunCommand = cmd({
|
|||||||
return Provider.defaultModel()
|
return Provider.defaultModel()
|
||||||
})()
|
})()
|
||||||
|
|
||||||
UI.println(UI.Style.TEXT_NORMAL_BOLD + "@ ", UI.Style.TEXT_NORMAL + `${providerID}/${modelID}`)
|
|
||||||
UI.empty()
|
|
||||||
|
|
||||||
function printEvent(color: string, type: string, title: string) {
|
function printEvent(color: string, type: string, title: string) {
|
||||||
UI.println(
|
UI.println(
|
||||||
color + `|`,
|
color + `|`,
|
||||||
@@ -137,7 +129,8 @@ export const RunCommand = cmd({
|
|||||||
if (part.type === "tool" && part.state.status === "completed") {
|
if (part.type === "tool" && part.state.status === "completed") {
|
||||||
const [tool, color] = TOOL[part.tool] ?? [part.tool, UI.Style.TEXT_INFO_BOLD]
|
const [tool, color] = TOOL[part.tool] ?? [part.tool, UI.Style.TEXT_INFO_BOLD]
|
||||||
const title =
|
const title =
|
||||||
part.state.title || Object.keys(part.state.input).length > 0 ? JSON.stringify(part.state.input) : "Unknown"
|
part.state.title ||
|
||||||
|
(Object.keys(part.state.input).length > 0 ? JSON.stringify(part.state.input) : "Unknown")
|
||||||
printEvent(color, tool, title)
|
printEvent(color, tool, title)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user