mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
chore: generate
This commit is contained in:
@@ -925,7 +925,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
.abort({
|
.abort({
|
||||||
sessionID,
|
sessionID,
|
||||||
})
|
})
|
||||||
.catch(() => { })
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
const addToHistory = (prompt: Prompt, mode: "normal" | "shell") => {
|
const addToHistory = (prompt: Prompt, mode: "normal" | "shell") => {
|
||||||
@@ -1351,18 +1351,18 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
|
|
||||||
const contextParts: Array<
|
const contextParts: Array<
|
||||||
| {
|
| {
|
||||||
id: string
|
id: string
|
||||||
type: "text"
|
type: "text"
|
||||||
text: string
|
text: string
|
||||||
synthetic?: boolean
|
synthetic?: boolean
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
id: string
|
id: string
|
||||||
type: "file"
|
type: "file"
|
||||||
mime: string
|
mime: string
|
||||||
url: string
|
url: string
|
||||||
filename?: string
|
filename?: string
|
||||||
}
|
}
|
||||||
> = []
|
> = []
|
||||||
|
|
||||||
const commentNote = (path: string, selection: FileSelection | undefined, comment: string) => {
|
const commentNote = (path: string, selection: FileSelection | undefined, comment: string) => {
|
||||||
@@ -1434,13 +1434,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
|
|
||||||
const optimisticParts = requestParts.map((part) => ({
|
const optimisticParts = requestParts.map((part) => ({
|
||||||
...part,
|
...part,
|
||||||
sessionID: session?.id || '',
|
sessionID: session?.id || "",
|
||||||
messageID,
|
messageID,
|
||||||
})) as unknown as Part[]
|
})) as unknown as Part[]
|
||||||
|
|
||||||
const optimisticMessage: Message = {
|
const optimisticMessage: Message = {
|
||||||
id: messageID,
|
id: messageID,
|
||||||
sessionID: session?.id || '',
|
sessionID: session?.id || "",
|
||||||
role: "user",
|
role: "user",
|
||||||
time: { created: Date.now() },
|
time: { created: Date.now() },
|
||||||
agent,
|
agent,
|
||||||
@@ -1451,9 +1451,9 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
if (sessionDirectory === projectDirectory) {
|
if (sessionDirectory === projectDirectory) {
|
||||||
sync.set(
|
sync.set(
|
||||||
produce((draft) => {
|
produce((draft) => {
|
||||||
const messages = draft.message[session?.id || '']
|
const messages = draft.message[session?.id || ""]
|
||||||
if (!messages) {
|
if (!messages) {
|
||||||
draft.message[session?.id || ''] = [optimisticMessage]
|
draft.message[session?.id || ""] = [optimisticMessage]
|
||||||
} else {
|
} else {
|
||||||
const result = Binary.search(messages, messageID, (m) => m.id)
|
const result = Binary.search(messages, messageID, (m) => m.id)
|
||||||
messages.splice(result.index, 0, optimisticMessage)
|
messages.splice(result.index, 0, optimisticMessage)
|
||||||
@@ -1469,9 +1469,9 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
|
|
||||||
globalSync.child(sessionDirectory)[1](
|
globalSync.child(sessionDirectory)[1](
|
||||||
produce((draft) => {
|
produce((draft) => {
|
||||||
const messages = draft.message[session?.id || '']
|
const messages = draft.message[session?.id || ""]
|
||||||
if (!messages) {
|
if (!messages) {
|
||||||
draft.message[session?.id || ''] = [optimisticMessage]
|
draft.message[session?.id || ""] = [optimisticMessage]
|
||||||
} else {
|
} else {
|
||||||
const result = Binary.search(messages, messageID, (m) => m.id)
|
const result = Binary.search(messages, messageID, (m) => m.id)
|
||||||
messages.splice(result.index, 0, optimisticMessage)
|
messages.splice(result.index, 0, optimisticMessage)
|
||||||
@@ -1488,7 +1488,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
if (sessionDirectory === projectDirectory) {
|
if (sessionDirectory === projectDirectory) {
|
||||||
sync.set(
|
sync.set(
|
||||||
produce((draft) => {
|
produce((draft) => {
|
||||||
const messages = draft.message[session?.id || '']
|
const messages = draft.message[session?.id || ""]
|
||||||
if (messages) {
|
if (messages) {
|
||||||
const result = Binary.search(messages, messageID, (m) => m.id)
|
const result = Binary.search(messages, messageID, (m) => m.id)
|
||||||
if (result.found) messages.splice(result.index, 1)
|
if (result.found) messages.splice(result.index, 1)
|
||||||
@@ -1501,7 +1501,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
|
|
||||||
globalSync.child(sessionDirectory)[1](
|
globalSync.child(sessionDirectory)[1](
|
||||||
produce((draft) => {
|
produce((draft) => {
|
||||||
const messages = draft.message[session?.id || '']
|
const messages = draft.message[session?.id || ""]
|
||||||
if (messages) {
|
if (messages) {
|
||||||
const result = Binary.search(messages, messageID, (m) => m.id)
|
const result = Binary.search(messages, messageID, (m) => m.id)
|
||||||
if (result.found) messages.splice(result.index, 1)
|
if (result.found) messages.splice(result.index, 1)
|
||||||
@@ -1547,7 +1547,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
restoreInput()
|
restoreInput()
|
||||||
}
|
}
|
||||||
|
|
||||||
pending.set(session?.id || '', { abort: controller, cleanup })
|
pending.set(session?.id || "", { abort: controller, cleanup })
|
||||||
|
|
||||||
const abort = new Promise<Awaited<ReturnType<typeof WorktreeState.wait>>>((resolve) => {
|
const abort = new Promise<Awaited<ReturnType<typeof WorktreeState.wait>>>((resolve) => {
|
||||||
if (controller.signal.aborted) {
|
if (controller.signal.aborted) {
|
||||||
@@ -1575,7 +1575,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
if (timer.id === undefined) return
|
if (timer.id === undefined) return
|
||||||
clearTimeout(timer.id)
|
clearTimeout(timer.id)
|
||||||
})
|
})
|
||||||
pending.delete(session?.id || '')
|
pending.delete(session?.id || "")
|
||||||
if (controller.signal.aborted) return false
|
if (controller.signal.aborted) return false
|
||||||
if (result.status === "failed") throw new Error(result.message)
|
if (result.status === "failed") throw new Error(result.message)
|
||||||
return true
|
return true
|
||||||
@@ -1585,7 +1585,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
const ok = await waitForWorktree()
|
const ok = await waitForWorktree()
|
||||||
if (!ok) return
|
if (!ok) return
|
||||||
await client.session.prompt({
|
await client.session.prompt({
|
||||||
sessionID: session?.id || '',
|
sessionID: session?.id || "",
|
||||||
agent,
|
agent,
|
||||||
model,
|
model,
|
||||||
messageID,
|
messageID,
|
||||||
@@ -1595,7 +1595,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send().catch((err) => {
|
void send().catch((err) => {
|
||||||
pending.delete(session?.id || '')
|
pending.delete(session?.id || "")
|
||||||
if (sessionDirectory === projectDirectory && session?.id) {
|
if (sessionDirectory === projectDirectory && session?.id) {
|
||||||
sync.set("session_status", session?.id, { type: "idle" })
|
sync.set("session_status", session?.id, { type: "idle" })
|
||||||
}
|
}
|
||||||
@@ -1620,8 +1620,12 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const currrentModelVariant = createMemo(() => {
|
const currrentModelVariant = createMemo(() => {
|
||||||
const modelVariant = local.model.variant.current() ?? ''
|
const modelVariant = local.model.variant.current() ?? ""
|
||||||
return modelVariant === 'xhigh' ? 'xHigh' : (modelVariant.length > 0 ? modelVariant[0].toUpperCase() + modelVariant.slice(1) : 'Default')
|
return modelVariant === "xhigh"
|
||||||
|
? "xHigh"
|
||||||
|
: modelVariant.length > 0
|
||||||
|
? modelVariant[0].toUpperCase() + modelVariant.slice(1)
|
||||||
|
: "Default"
|
||||||
})
|
})
|
||||||
|
|
||||||
const reasoningPercentage = createMemo(() => {
|
const reasoningPercentage = createMemo(() => {
|
||||||
@@ -1629,7 +1633,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
const current = local.model.variant.current()
|
const current = local.model.variant.current()
|
||||||
const totalEntries = variants.length + 1
|
const totalEntries = variants.length + 1
|
||||||
|
|
||||||
if (totalEntries <= 2 || current === 'Default') {
|
if (totalEntries <= 2 || current === "Default") {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1943,7 +1947,11 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
title={language.t("command.model.choose")}
|
title={language.t("command.model.choose")}
|
||||||
keybind={command.keybind("model.choose")}
|
keybind={command.keybind("model.choose")}
|
||||||
>
|
>
|
||||||
<Button as="div" variant="ghost" onClick={() => dialog.render(<DialogSelectModelUnpaid />, "select-model")}>
|
<Button
|
||||||
|
as="div"
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => dialog.render(<DialogSelectModelUnpaid />, "select-model")}
|
||||||
|
>
|
||||||
<Show when={local.model.current()?.provider?.id}>
|
<Show when={local.model.current()?.provider?.id}>
|
||||||
<ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
|
<ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
|
||||||
</Show>
|
</Show>
|
||||||
|
|||||||
@@ -61,24 +61,24 @@ export const SettingsGeneral: Component = () => {
|
|||||||
const actions =
|
const actions =
|
||||||
platform.update && platform.restart
|
platform.update && platform.restart
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: language.t("toast.update.action.installRestart"),
|
label: language.t("toast.update.action.installRestart"),
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
await platform.update!()
|
await platform.update!()
|
||||||
await platform.restart!()
|
await platform.restart!()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
label: language.t("toast.update.action.notYet"),
|
||||||
label: language.t("toast.update.action.notYet"),
|
onClick: "dismiss" as const,
|
||||||
onClick: "dismiss" as const,
|
},
|
||||||
},
|
]
|
||||||
]
|
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
label: language.t("toast.update.action.notYet"),
|
label: language.t("toast.update.action.notYet"),
|
||||||
onClick: "dismiss" as const,
|
onClick: "dismiss" as const,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
showToast({
|
showToast({
|
||||||
persistent: true,
|
persistent: true,
|
||||||
|
|||||||
@@ -268,13 +268,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
|
|||||||
{searchAction()}
|
{searchAction()}
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
<ScrollFade
|
<ScrollFade ref={setScrollRef} direction="vertical" fadeStartSize={0} fadeEndSize={20} data-slot="list-scroll">
|
||||||
ref={setScrollRef}
|
|
||||||
direction="vertical"
|
|
||||||
fadeStartSize={0}
|
|
||||||
fadeEndSize={20}
|
|
||||||
data-slot="list-scroll"
|
|
||||||
>
|
|
||||||
<Show
|
<Show
|
||||||
when={flat().length > 0 || showAdd()}
|
when={flat().length > 0 || showAdd()}
|
||||||
fallback={
|
fallback={
|
||||||
|
|||||||
@@ -111,7 +111,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[data-component="text-part"] {
|
[data-component="text-part"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,22 @@ export function ReasoningIcon(props: ReasoningIconProps) {
|
|||||||
[split.class ?? ""]: !!split.class,
|
[split.class ?? ""]: !!split.class,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<path d="M5.83196 10.3225V11.1666C5.83196 11.7189 6.27967 12.1666 6.83196 12.1666H9.16687C9.71915 12.1666 10.1669 11.7189 10.1669 11.1666V10.3225M5.83196 10.3225C5.55695 10.1843 5.29695 10.0206 5.05505 9.83459C3.90601 8.95086 3.16549 7.56219 3.16549 6.00055C3.16549 3.33085 5.32971 1.16663 7.99941 1.16663C10.6691 1.16663 12.8333 3.33085 12.8333 6.00055C12.8333 7.56219 12.0928 8.95086 10.9438 9.83459C10.7019 10.0206 10.4419 10.1843 10.1669 10.3225M5.83196 10.3225H10.1669M6.5 14.1666H9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
<path
|
||||||
<circle cx="8" cy="5.83325" r="2.86364" fill="currentColor" stroke="currentColor" stroke-width={strokeWidth()} style={{ '--reasoning-icon-percentage': split.percentage / 100 }} data-slot="reasoning-icon-percentage" />
|
d="M5.83196 10.3225V11.1666C5.83196 11.7189 6.27967 12.1666 6.83196 12.1666H9.16687C9.71915 12.1666 10.1669 11.7189 10.1669 11.1666V10.3225M5.83196 10.3225C5.55695 10.1843 5.29695 10.0206 5.05505 9.83459C3.90601 8.95086 3.16549 7.56219 3.16549 6.00055C3.16549 3.33085 5.32971 1.16663 7.99941 1.16663C10.6691 1.16663 12.8333 3.33085 12.8333 6.00055C12.8333 7.56219 12.0928 8.95086 10.9438 9.83459C10.7019 10.0206 10.4419 10.1843 10.1669 10.3225M5.83196 10.3225H10.1669M6.5 14.1666H9.5"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
/>
|
||||||
|
<circle
|
||||||
|
cx="8"
|
||||||
|
cy="5.83325"
|
||||||
|
r="2.86364"
|
||||||
|
fill="currentColor"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width={strokeWidth()}
|
||||||
|
style={{ "--reasoning-icon-percentage": split.percentage / 100 }}
|
||||||
|
data-slot="reasoning-icon-percentage"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,34 +35,14 @@
|
|||||||
|
|
||||||
/* Only start fade */
|
/* Only start fade */
|
||||||
&[data-fade-start]:not([data-fade-end]) {
|
&[data-fade-start]:not([data-fade-end]) {
|
||||||
mask-image: linear-gradient(
|
mask-image: linear-gradient(to right, transparent, black var(--scroll-fade-start), black 100%);
|
||||||
to right,
|
-webkit-mask-image: linear-gradient(to right, transparent, black var(--scroll-fade-start), black 100%);
|
||||||
transparent,
|
|
||||||
black var(--scroll-fade-start),
|
|
||||||
black 100%
|
|
||||||
);
|
|
||||||
-webkit-mask-image: linear-gradient(
|
|
||||||
to right,
|
|
||||||
transparent,
|
|
||||||
black var(--scroll-fade-start),
|
|
||||||
black 100%
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only end fade */
|
/* Only end fade */
|
||||||
&:not([data-fade-start])[data-fade-end] {
|
&:not([data-fade-start])[data-fade-end] {
|
||||||
mask-image: linear-gradient(
|
mask-image: linear-gradient(to right, black 0%, black calc(100% - var(--scroll-fade-end)), transparent);
|
||||||
to right,
|
-webkit-mask-image: linear-gradient(to right, black 0%, black calc(100% - var(--scroll-fade-end)), transparent);
|
||||||
black 0%,
|
|
||||||
black calc(100% - var(--scroll-fade-end)),
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
-webkit-mask-image: linear-gradient(
|
|
||||||
to right,
|
|
||||||
black 0%,
|
|
||||||
black calc(100% - var(--scroll-fade-end)),
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,34 +69,14 @@
|
|||||||
|
|
||||||
/* Only start fade */
|
/* Only start fade */
|
||||||
&[data-fade-start]:not([data-fade-end]) {
|
&[data-fade-start]:not([data-fade-end]) {
|
||||||
mask-image: linear-gradient(
|
mask-image: linear-gradient(to bottom, transparent, black var(--scroll-fade-start), black 100%);
|
||||||
to bottom,
|
-webkit-mask-image: linear-gradient(to bottom, transparent, black var(--scroll-fade-start), black 100%);
|
||||||
transparent,
|
|
||||||
black var(--scroll-fade-start),
|
|
||||||
black 100%
|
|
||||||
);
|
|
||||||
-webkit-mask-image: linear-gradient(
|
|
||||||
to bottom,
|
|
||||||
transparent,
|
|
||||||
black var(--scroll-fade-start),
|
|
||||||
black 100%
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only end fade */
|
/* Only end fade */
|
||||||
&:not([data-fade-start])[data-fade-end] {
|
&:not([data-fade-start])[data-fade-end] {
|
||||||
mask-image: linear-gradient(
|
mask-image: linear-gradient(to bottom, black 0%, black calc(100% - var(--scroll-fade-end)), transparent);
|
||||||
to bottom,
|
-webkit-mask-image: linear-gradient(to bottom, black 0%, black calc(100% - var(--scroll-fade-end)), transparent);
|
||||||
black 0%,
|
|
||||||
black calc(100% - var(--scroll-fade-end)),
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
-webkit-mask-image: linear-gradient(
|
|
||||||
to bottom,
|
|
||||||
black 0%,
|
|
||||||
black calc(100% - var(--scroll-fade-end)),
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,4 @@
|
|||||||
import {
|
import { type JSX, createEffect, createSignal, onCleanup, onMount, splitProps } from "solid-js"
|
||||||
type JSX,
|
|
||||||
createEffect,
|
|
||||||
createSignal,
|
|
||||||
onCleanup,
|
|
||||||
onMount,
|
|
||||||
splitProps,
|
|
||||||
} from "solid-js"
|
|
||||||
import "./scroll-fade.css"
|
import "./scroll-fade.css"
|
||||||
|
|
||||||
export interface ScrollFadeProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
export interface ScrollFadeProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { type JSX, onCleanup, splitProps } from "solid-js"
|
import { type JSX, onCleanup, splitProps } from "solid-js"
|
||||||
import { ScrollFade, type ScrollFadeProps } from './scroll-fade'
|
import { ScrollFade, type ScrollFadeProps } from "./scroll-fade"
|
||||||
|
|
||||||
const SCROLL_SPEED = 60
|
const SCROLL_SPEED = 60
|
||||||
const PAUSE_DURATION = 800
|
const PAUSE_DURATION = 800
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ export function SessionTurn(
|
|||||||
data-slot="session-turn-collapsible-trigger-content"
|
data-slot="session-turn-collapsible-trigger-content"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="small"
|
size="small"
|
||||||
onClick={props.onStepsExpandedToggle ?? (() => { })}
|
onClick={props.onStepsExpandedToggle ?? (() => {})}
|
||||||
aria-expanded={props.stepsExpanded}
|
aria-expanded={props.stepsExpanded}
|
||||||
>
|
>
|
||||||
<Switch>
|
<Switch>
|
||||||
|
|||||||
@@ -105,12 +105,16 @@ function init() {
|
|||||||
|
|
||||||
const render = (element: JSX.Element, id: string, owner: Owner) => {
|
const render = (element: JSX.Element, id: string, owner: Owner) => {
|
||||||
setRenders((renders) => ({ ...renders, [id]: element }))
|
setRenders((renders) => ({ ...renders, [id]: element }))
|
||||||
show(() => element, owner, () => {
|
show(
|
||||||
setRenders((renders) => {
|
() => element,
|
||||||
const { [id]: _, ...rest } = renders
|
owner,
|
||||||
return rest
|
() => {
|
||||||
})
|
setRenders((renders) => {
|
||||||
})
|
const { [id]: _, ...rest } = renders
|
||||||
|
return rest
|
||||||
|
})
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const isActive = (id: string) => {
|
const isActive = (id: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user