|
@@ -15,7 +15,7 @@ import path from "path"
|
|
|
import { useRouteData } from "@tui/context/route"
|
|
import { useRouteData } from "@tui/context/route"
|
|
|
import { useSync } from "@tui/context/sync"
|
|
import { useSync } from "@tui/context/sync"
|
|
|
import { SplitBorder } from "@tui/component/border"
|
|
import { SplitBorder } from "@tui/component/border"
|
|
|
-import { SyntaxTheme, useTheme } from "@tui/context/theme"
|
|
|
|
|
|
|
+import { useTheme } from "@tui/context/theme"
|
|
|
import { BoxRenderable, ScrollBoxRenderable, addDefaultParsers } from "@opentui/core"
|
|
import { BoxRenderable, ScrollBoxRenderable, addDefaultParsers } from "@opentui/core"
|
|
|
import { Prompt, type PromptRef } from "@tui/component/prompt"
|
|
import { Prompt, type PromptRef } from "@tui/component/prompt"
|
|
|
import type {
|
|
import type {
|
|
@@ -641,7 +641,7 @@ function UserMessage(props: {
|
|
|
borderColor={color()}
|
|
borderColor={color()}
|
|
|
flexShrink={0}
|
|
flexShrink={0}
|
|
|
>
|
|
>
|
|
|
- <text>{text()?.text}</text>
|
|
|
|
|
|
|
+ <text fg={theme.text}>{text()?.text}</text>
|
|
|
<Show when={files().length}>
|
|
<Show when={files().length}>
|
|
|
<box flexDirection="row" paddingBottom={1} paddingTop={1} gap={1} flexWrap="wrap">
|
|
<box flexDirection="row" paddingBottom={1} paddingTop={1} gap={1} flexWrap="wrap">
|
|
|
<For each={files()}>
|
|
<For each={files()}>
|
|
@@ -652,7 +652,7 @@ function UserMessage(props: {
|
|
|
return theme.secondary
|
|
return theme.secondary
|
|
|
})
|
|
})
|
|
|
return (
|
|
return (
|
|
|
- <text>
|
|
|
|
|
|
|
+ <text fg={theme.text}>
|
|
|
<span style={{ bg: bg(), fg: theme.background }}>
|
|
<span style={{ bg: bg(), fg: theme.background }}>
|
|
|
{" "}
|
|
{" "}
|
|
|
{MIME_BADGE[file.mime] ?? file.mime}{" "}
|
|
{MIME_BADGE[file.mime] ?? file.mime}{" "}
|
|
@@ -667,7 +667,7 @@ function UserMessage(props: {
|
|
|
</For>
|
|
</For>
|
|
|
</box>
|
|
</box>
|
|
|
</Show>
|
|
</Show>
|
|
|
- <text>
|
|
|
|
|
|
|
+ <text fg={theme.text}>
|
|
|
{sync.data.config.username ?? "You"}{" "}
|
|
{sync.data.config.username ?? "You"}{" "}
|
|
|
<Show
|
|
<Show
|
|
|
when={queued()}
|
|
when={queued()}
|
|
@@ -782,7 +782,7 @@ function ReasoningPart(props: { part: ReasoningPart; message: AssistantMessage }
|
|
|
paddingLeft={2}
|
|
paddingLeft={2}
|
|
|
backgroundColor={theme.backgroundPanel}
|
|
backgroundColor={theme.backgroundPanel}
|
|
|
>
|
|
>
|
|
|
- <text>{props.part.text.trim()}</text>
|
|
|
|
|
|
|
+ <text fg={theme.text}>{props.part.text.trim()}</text>
|
|
|
</box>
|
|
</box>
|
|
|
</box>
|
|
</box>
|
|
|
</Show>
|
|
</Show>
|
|
@@ -791,13 +791,14 @@ function ReasoningPart(props: { part: ReasoningPart; message: AssistantMessage }
|
|
|
|
|
|
|
|
function TextPart(props: { part: TextPart; message: AssistantMessage }) {
|
|
function TextPart(props: { part: TextPart; message: AssistantMessage }) {
|
|
|
const ctx = use()
|
|
const ctx = use()
|
|
|
|
|
+ const { syntax } = useTheme()
|
|
|
return (
|
|
return (
|
|
|
<Show when={props.part.text.trim()}>
|
|
<Show when={props.part.text.trim()}>
|
|
|
<box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}>
|
|
<box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}>
|
|
|
<code
|
|
<code
|
|
|
filetype="markdown"
|
|
filetype="markdown"
|
|
|
drawUnstyledText={false}
|
|
drawUnstyledText={false}
|
|
|
- syntaxStyle={SyntaxTheme}
|
|
|
|
|
|
|
+ syntaxStyle={syntax()}
|
|
|
content={props.part.text.trim()}
|
|
content={props.part.text.trim()}
|
|
|
conceal={ctx.conceal()}
|
|
conceal={ctx.conceal()}
|
|
|
/>
|
|
/>
|
|
@@ -997,7 +998,7 @@ ToolRegistry.register<typeof WriteTool>({
|
|
|
name: "write",
|
|
name: "write",
|
|
|
container: "block",
|
|
container: "block",
|
|
|
render(props) {
|
|
render(props) {
|
|
|
- const { theme } = useTheme()
|
|
|
|
|
|
|
+ const { theme, syntax } = useTheme()
|
|
|
const lines = createMemo(() => {
|
|
const lines = createMemo(() => {
|
|
|
return props.input.content?.split("\n") ?? []
|
|
return props.input.content?.split("\n") ?? []
|
|
|
})
|
|
})
|
|
@@ -1028,7 +1029,7 @@ ToolRegistry.register<typeof WriteTool>({
|
|
|
<box paddingLeft={1} flexGrow={1}>
|
|
<box paddingLeft={1} flexGrow={1}>
|
|
|
<code
|
|
<code
|
|
|
filetype={filetype(props.input.filePath!)}
|
|
filetype={filetype(props.input.filePath!)}
|
|
|
- syntaxStyle={SyntaxTheme}
|
|
|
|
|
|
|
+ syntaxStyle={syntax()}
|
|
|
content={code()}
|
|
content={code()}
|
|
|
/>
|
|
/>
|
|
|
</box>
|
|
</box>
|
|
@@ -1131,6 +1132,7 @@ ToolRegistry.register<typeof EditTool>({
|
|
|
container: "block",
|
|
container: "block",
|
|
|
render(props) {
|
|
render(props) {
|
|
|
const ctx = use()
|
|
const ctx = use()
|
|
|
|
|
+ const { theme, syntax } = useTheme()
|
|
|
|
|
|
|
|
const style = createMemo(() => (ctx.width > 120 ? "split" : "stacked"))
|
|
const style = createMemo(() => (ctx.width > 120 ? "split" : "stacked"))
|
|
|
|
|
|
|
@@ -1210,21 +1212,21 @@ ToolRegistry.register<typeof EditTool>({
|
|
|
</ToolTitle>
|
|
</ToolTitle>
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Match when={props.permission["diff"]}>
|
|
<Match when={props.permission["diff"]}>
|
|
|
- <text>{props.permission["diff"]?.trim()}</text>
|
|
|
|
|
|
|
+ <text fg={theme.text}>{props.permission["diff"]?.trim()}</text>
|
|
|
</Match>
|
|
</Match>
|
|
|
<Match when={diff() && style() === "split"}>
|
|
<Match when={diff() && style() === "split"}>
|
|
|
<box paddingLeft={1} flexDirection="row" gap={2}>
|
|
<box paddingLeft={1} flexDirection="row" gap={2}>
|
|
|
<box flexGrow={1} flexBasis={0}>
|
|
<box flexGrow={1} flexBasis={0}>
|
|
|
- <code filetype={ft()} syntaxStyle={SyntaxTheme} content={diff()!.oldContent} />
|
|
|
|
|
|
|
+ <code filetype={ft()} syntaxStyle={syntax()} content={diff()!.oldContent} />
|
|
|
</box>
|
|
</box>
|
|
|
<box flexGrow={1} flexBasis={0}>
|
|
<box flexGrow={1} flexBasis={0}>
|
|
|
- <code filetype={ft()} syntaxStyle={SyntaxTheme} content={diff()!.newContent} />
|
|
|
|
|
|
|
+ <code filetype={ft()} syntaxStyle={syntax()} content={diff()!.newContent} />
|
|
|
</box>
|
|
</box>
|
|
|
</box>
|
|
</box>
|
|
|
</Match>
|
|
</Match>
|
|
|
<Match when={code()}>
|
|
<Match when={code()}>
|
|
|
<box paddingLeft={1}>
|
|
<box paddingLeft={1}>
|
|
|
- <code filetype={ft()} syntaxStyle={SyntaxTheme} content={code()} />
|
|
|
|
|
|
|
+ <code filetype={ft()} syntaxStyle={syntax()} content={code()} />
|
|
|
</box>
|
|
</box>
|
|
|
</Match>
|
|
</Match>
|
|
|
</Switch>
|
|
</Switch>
|
|
@@ -1237,6 +1239,7 @@ ToolRegistry.register<typeof PatchTool>({
|
|
|
name: "patch",
|
|
name: "patch",
|
|
|
container: "block",
|
|
container: "block",
|
|
|
render(props) {
|
|
render(props) {
|
|
|
|
|
+ const { theme } = useTheme()
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<ToolTitle icon="%" fallback="Preparing patch..." when={true}>
|
|
<ToolTitle icon="%" fallback="Preparing patch..." when={true}>
|
|
@@ -1244,7 +1247,7 @@ ToolRegistry.register<typeof PatchTool>({
|
|
|
</ToolTitle>
|
|
</ToolTitle>
|
|
|
<Show when={props.output}>
|
|
<Show when={props.output}>
|
|
|
<box>
|
|
<box>
|
|
|
- <text>{props.output?.trim()}</text>
|
|
|
|
|
|
|
+ <text fg={theme.text}>{props.output?.trim()}</text>
|
|
|
</box>
|
|
</box>
|
|
|
</Show>
|
|
</Show>
|
|
|
</>
|
|
</>
|