mirror of
https://github.com/anomalyco/opencode.git
synced 2026-03-03 21:23:53 +00:00
Compare commits
14 Commits
production
...
tweaks
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc2c9c7673 | ||
|
|
07025ef5b9 | ||
|
|
6dd903c348 | ||
|
|
37fdbe7fa6 | ||
|
|
c27779e1b2 | ||
|
|
8d232d35eb | ||
|
|
98309fdd58 | ||
|
|
50cb49fa6c | ||
|
|
ec56e95b9c | ||
|
|
ce9900dca0 | ||
|
|
5527b4ea4d | ||
|
|
1f3ee037aa | ||
|
|
e5c5c1df12 | ||
|
|
0a451c73c9 |
@@ -241,7 +241,6 @@ export function Session() {
|
||||
const logo = UI.logo(" ").split(/\r?\n/)
|
||||
return exit.message.set(
|
||||
[
|
||||
``,
|
||||
`${logo[0] ?? ""}`,
|
||||
`${logo[1] ?? ""}`,
|
||||
`${logo[2] ?? ""}`,
|
||||
@@ -1879,10 +1878,8 @@ function Read(props: ToolProps<typeof ReadTool>) {
|
||||
</InlineTool>
|
||||
<For each={loaded()}>
|
||||
{(filepath) => (
|
||||
<box paddingLeft={3}>
|
||||
<text paddingLeft={3} fg={theme.textMuted}>
|
||||
↳ Loaded {normalizePath(filepath)}
|
||||
</text>
|
||||
<box paddingLeft={5}>
|
||||
<text fg={theme.textMuted}>⤷ Loaded {normalizePath(filepath)}</text>
|
||||
</box>
|
||||
)}
|
||||
</For>
|
||||
@@ -1976,33 +1973,32 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
||||
return assistant - first
|
||||
})
|
||||
|
||||
const content = createMemo(() => {
|
||||
if (!props.input.description) return ""
|
||||
let content = [`Task ${props.input.description}`]
|
||||
|
||||
if (isRunning() && tools().length > 0) {
|
||||
// content[0] += ` · ${tools().length} toolcalls`
|
||||
if (current()) content.push(`⤷ ${Locale.titlecase(current()!.tool)} ${(current()!.state as any).title}`)
|
||||
else content.push(`⤷ ${tools().length} toolcalls`)
|
||||
}
|
||||
|
||||
if (props.part.state.status === "completed") {
|
||||
content.push(`└ ${tools().length} toolcalls · ${Locale.duration(duration())}`)
|
||||
}
|
||||
|
||||
return content.join("\n")
|
||||
})
|
||||
|
||||
return (
|
||||
<InlineTool
|
||||
icon="≡"
|
||||
icon="│"
|
||||
spinner={isRunning()}
|
||||
complete={props.input.description}
|
||||
pending="Delegating..."
|
||||
part={props.part}
|
||||
>
|
||||
{props.input.description}
|
||||
<Show when={isRunning() && tools().length > 0}>
|
||||
{" "}
|
||||
· {tools().length} toolcalls
|
||||
<Show fallback={"\n└ Running..."} when={current()}>
|
||||
{(item) => {
|
||||
const title = createMemo(() => (item().state as any).title)
|
||||
return (
|
||||
<>
|
||||
{"\n"}└ {Locale.titlecase(item().tool)} {title()}
|
||||
</>
|
||||
)
|
||||
}}
|
||||
</Show>
|
||||
</Show>
|
||||
<Show when={duration() && props.part.state.status === "completed"}>
|
||||
{"\n "}
|
||||
{tools().length} toolcalls · {Locale.duration(duration())}
|
||||
</Show>
|
||||
{content()}
|
||||
</InlineTool>
|
||||
)
|
||||
}
|
||||
@@ -2222,10 +2218,16 @@ function Diagnostics(props: { diagnostics?: Record<string, Record<string, any>[]
|
||||
|
||||
function normalizePath(input?: string) {
|
||||
if (!input) return ""
|
||||
if (path.isAbsolute(input)) {
|
||||
return path.relative(process.cwd(), input) || "."
|
||||
}
|
||||
return input
|
||||
|
||||
const cwd = process.cwd()
|
||||
const absolute = path.isAbsolute(input) ? input : path.resolve(cwd, input)
|
||||
const relative = path.relative(cwd, absolute)
|
||||
|
||||
if (!relative) return "."
|
||||
if (!relative.startsWith("..")) return relative
|
||||
|
||||
// outside cwd - use absolute
|
||||
return absolute
|
||||
}
|
||||
|
||||
function input(input: Record<string, any>, omit?: string[]): string {
|
||||
|
||||
Reference in New Issue
Block a user