chore: generate

This commit is contained in:
opencode-agent[bot]
2026-06-07 21:27:42 +00:00
parent 07808bea12
commit 3867fa2bad
12 changed files with 170 additions and 153 deletions

View File

@@ -298,7 +298,14 @@ function PanelShell(props: {
</box> </box>
)} )}
{minimal() ? ( {minimal() ? (
<box id={`${props.id}-bottom`} width="100%" height={1} border={false} backgroundColor="transparent" flexShrink={0}> <box
id={`${props.id}-bottom`}
width="100%"
height={1}
border={false}
backgroundColor="transparent"
flexShrink={0}
>
<box <box
width="100%" width="100%"
height={1} height={1}
@@ -368,17 +375,18 @@ export function RunCommandMenuBody(props: {
}, },
...(props.subagents().length > 0 ...(props.subagents().length > 0
? [ ? [
{ {
action: "subagent" as const, action: "subagent" as const,
category: "Session", category: "Session",
display: "View subagents", display: "View subagents",
footer: activeSubagentCount() > 0 ? `${activeSubagentCount()} active` : `${props.subagents().length} recent`, footer:
keywords: props activeSubagentCount() > 0 ? `${activeSubagentCount()} active` : `${props.subagents().length} recent`,
.subagents() keywords: props
.map((item) => `${item.label} ${item.description} ${item.title ?? ""}`) .subagents()
.join(" "), .map((item) => `${item.label} ${item.description} ${item.title ?? ""}`)
}, .join(" "),
] },
]
: []), : []),
{ {
action: "slash", action: "slash",
@@ -392,16 +400,16 @@ export function RunCommandMenuBody(props: {
const prompt: CommandEntry[] = const prompt: CommandEntry[] =
props.commands() === undefined || skills().length > 0 props.commands() === undefined || skills().length > 0
? [ ? [
{ {
action: "skill" as const, action: "skill" as const,
category: "Prompt", category: "Prompt",
display: "Skills", display: "Skills",
footer: "/skills", footer: "/skills",
keywords: `skill skills ${skills() keywords: `skill skills ${skills()
.map((item) => `${item.name} ${item.description ?? ""}`) .map((item) => `${item.name} ${item.description ?? ""}`)
.join(" ")}`.trim(), .join(" ")}`.trim(),
}, },
] ]
: [] : []
const agent: CommandEntry[] = [ const agent: CommandEntry[] = [
{ {
@@ -411,17 +419,17 @@ export function RunCommandMenuBody(props: {
}, },
...(props.queued().length > 0 ...(props.queued().length > 0
? [ ? [
{ {
action: "queued" as const, action: "queued" as const,
category: "Agent", category: "Agent",
display: "Manage queued prompts", display: "Manage queued prompts",
footer: `${props.queued().length} queued`, footer: `${props.queued().length} queued`,
keywords: props keywords: props
.queued() .queued()
.map((item) => item.prompt.text) .map((item) => item.prompt.text)
.join(" "), .join(" "),
}, },
] ]
: []), : []),
{ {
action: "variant.cycle", action: "variant.cycle",
@@ -432,13 +440,13 @@ export function RunCommandMenuBody(props: {
}, },
...(props.variants().length > 0 ...(props.variants().length > 0
? [ ? [
{ {
action: "variant.list" as const, action: "variant.list" as const,
category: "Agent", category: "Agent",
display: "Switch model variant", display: "Switch model variant",
keywords: `variant variants ${props.variants().join(" ")}`, keywords: `variant variants ${props.variants().join(" ")}`,
}, },
] ]
: []), : []),
] ]
const commands = (props.commands() ?? []) const commands = (props.commands() ?? [])

View File

@@ -264,7 +264,12 @@ export function RunFooterMenu(props: {
if (row.type === "header") { if (row.type === "header") {
return ( return (
<box paddingLeft={props.paddingLeft ?? 1} paddingRight={props.paddingRight ?? 1}> <box paddingLeft={props.paddingLeft ?? 1} paddingRight={props.paddingRight ?? 1}>
<text fg={props.headerColor ?? props.theme().highlight} attributes={TextAttributes.BOLD} wrapMode="none" truncate> <text
fg={props.headerColor ?? props.theme().highlight}
attributes={TextAttributes.BOLD}
wrapMode="none"
truncate
>
{row.label} {row.label}
</text> </text>
</box> </box>
@@ -281,11 +286,7 @@ export function RunFooterMenu(props: {
? props.theme().shade ? props.theme().shade
: transparent : transparent
return ( return (
<box <box paddingRight={0} flexDirection="row" backgroundColor={background()}>
paddingRight={0}
flexDirection="row"
backgroundColor={background()}
>
{border() ? ( {border() ? (
<text fg={props.theme().highlight} bg={background()} wrapMode="none"> <text fg={props.theme().highlight} bg={background()} wrapMode="none">
{active() ? "▌" : " "} {active() ? "▌" : " "}

View File

@@ -234,7 +234,7 @@ export function RunPromptBody(props: {
props.onContentChange() props.onContentChange()
}) })
.catch(() => { }) .catch(() => {})
}, 0) }, 0)
} }
@@ -1200,7 +1200,11 @@ export function createPromptState(input: PromptInput): PromptState {
return return
} }
const submit = command ? { ...next, command } : parsed?.type === "command" ? { ...next, command: parsed.command } : next const submit = command
? { ...next, command }
: parsed?.type === "command"
? { ...next, command: parsed.command }
: next
const shellMode = next.mode === "shell" const shellMode = next.mode === "shell"
resetDraft() resetDraft()

View File

@@ -720,14 +720,14 @@ export class RunFooter implements FooterApi {
: this.promptRoute.type === "model" : this.promptRoute.type === "model"
? 1 + MODEL_ROWS ? 1 + MODEL_ROWS
: this.promptRoute.type === "variant" : this.promptRoute.type === "variant"
? 1 + VARIANT_ROWS ? 1 + VARIANT_ROWS
: this.promptRoute.type === "queued-menu" : this.promptRoute.type === "queued-menu"
? 1 + this.subagentMenuRows
: this.promptRoute.type === "subagent-menu"
? 1 + this.subagentMenuRows ? 1 + this.subagentMenuRows
: this.promptRoute.type === "subagent" : this.promptRoute.type === "subagent-menu"
? this.base + SUBAGENT_INSPECTOR_ROWS ? 1 + this.subagentMenuRows
: this.base + Math.max(TEXTAREA_MIN_ROWS, Math.min(PROMPT_MAX_ROWS, this.rows)) : this.promptRoute.type === "subagent"
? this.base + SUBAGENT_INSPECTOR_ROWS
: this.base + Math.max(TEXTAREA_MIN_ROWS, Math.min(PROMPT_MAX_ROWS, this.rows))
if (height !== this.renderer.footerHeight) { if (height !== this.renderer.footerHeight) {
this.renderer.footerHeight = height this.renderer.footerHeight = height

View File

@@ -166,7 +166,9 @@ export function RunFooterView(props: RunFooterViewProps) {
return tabs().findIndex((item) => item.sessionID === sessionID) + 1 return tabs().findIndex((item) => item.sessionID === sessionID) + 1
}) })
const foregroundSubagents = createMemo(() => props.backgroundSubagents && activeTabs().some((item) => !item.background)) const foregroundSubagents = createMemo(
() => props.backgroundSubagents && activeTabs().some((item) => !item.background),
)
const model = createMemo(() => { const model = createMemo(() => {
const current = props.currentModel() const current = props.currentModel()
return current ? modelInfo(props.providers(), current) : { model: props.state().model, provider: undefined } return current ? modelInfo(props.providers(), current) : { model: props.state().model, provider: undefined }
@@ -648,9 +650,9 @@ export function RunFooterView(props: RunFooterViewProps) {
panel() || prompt() panel() || prompt()
? undefined ? undefined
: { : {
...EMPTY_BORDER, ...EMPTY_BORDER,
vertical: "█", vertical: "█",
} }
} }
> >
<box <box
@@ -938,7 +940,9 @@ export function RunFooterView(props: RunFooterViewProps) {
maxWidth={18} maxWidth={18}
> >
<text fg={theme().text} wrapMode="none" truncate> <text fg={theme().text} wrapMode="none" truncate>
<Show when={hasActivityMeta() || hasModelStatus() || hasContextHints()}>{sectionSeparator()}</Show> <Show when={hasActivityMeta() || hasModelStatus() || hasContextHints()}>
{sectionSeparator()}
</Show>
<span style={{ fg: theme().text }}>{hint().key}</span>{" "} <span style={{ fg: theme().text }}>{hint().key}</span>{" "}
<span style={{ fg: theme().muted }}>{hint().label}</span> <span style={{ fg: theme().muted }}>{hint().label}</span>
</text> </text>

View File

@@ -96,12 +96,7 @@ function promptPartStart(part: Mention) {
return part.source?.text.start ?? Number.POSITIVE_INFINITY return part.source?.text.start ?? Number.POSITIVE_INFINITY
} }
function findPromptPartIndex( function findPromptPartIndex(content: string, text: string, used: Array<{ start: number; end: number }>, hint: number) {
content: string,
text: string,
used: Array<{ start: number; end: number }>,
hint: number,
) {
let searchFrom = 0 let searchFrom = 0
let best = -1 let best = -1
let distance = Number.POSITIVE_INFINITY let distance = Number.POSITIVE_INFINITY

View File

@@ -341,7 +341,10 @@ export function turnSummaryWriter(input: { agent: string; model: string; duratio
<text wrapMode="none" truncate> <text wrapMode="none" truncate>
<span style={{ fg: input.theme.block.highlight }}> </span> <span style={{ fg: input.theme.block.highlight }}> </span>
<span style={{ fg: input.theme.block.text }}>{input.agent}</span> <span style={{ fg: input.theme.block.text }}>{input.agent}</span>
<span style={{ fg: input.theme.block.muted }}> · {input.model} · {input.duration}</span> <span style={{ fg: input.theme.block.muted }}>
{" "}
· {input.model} · {input.duration}
</span>
</text> </text>
</box> </box>
), ),

View File

@@ -217,7 +217,9 @@ function replayMessage(
commits.push(...next.commits) commits.push(...next.commits)
} }
const summary = config.summaries.has(message.info.id) ? messageTurnSummaryCommit(message, config.providers) : undefined const summary = config.summaries.has(message.info.id)
? messageTurnSummaryCommit(message, config.providers)
: undefined
if (summary) { if (summary) {
commits.push(summary) commits.push(summary)
} }

View File

@@ -713,10 +713,10 @@ function createLayer(input: StreamInput) {
messages: messagesList, messages: messagesList,
permissions: sessionPermissions, permissions: sessionPermissions,
questions: sessionQuestions, questions: sessionQuestions,
thinking: input.thinking, thinking: input.thinking,
limits: input.limits(), limits: input.limits(),
providers: input.providers?.(), providers: input.providers?.(),
}) })
: undefined : undefined
const replay = const replay =
history && input.replayLimit !== undefined && messagesList.length > input.replayLimit history && input.replayLimit !== undefined && messagesList.length > input.replayLimit

View File

@@ -829,9 +829,10 @@ export function reduceSubagentData(input: {
} }
const detail = ensureDetail(input.data, sessionID) const detail = ensureDetail(input.data, sessionID)
const cancelled = event.type === "message.updated" && isAbortedAssistantMessage(event.properties.info) const cancelled =
? cancelSubagentTab(input.data, sessionID) event.type === "message.updated" && isAbortedAssistantMessage(event.properties.info)
: false ? cancelSubagentTab(input.data, sessionID)
: false
if (event.type === "session.status") { if (event.type === "session.status") {
if (event.properties.status.type !== "retry") { if (event.properties.status.type !== "retry") {
return cancelled return cancelled
@@ -839,13 +840,13 @@ export function reduceSubagentData(input: {
return ( return (
appendCommits(detail, [ appendCommits(detail, [
{ {
kind: "error", kind: "error",
text: event.properties.status.message, text: event.properties.status.message,
phase: "start", phase: "start",
source: "system", source: "system",
messageID: `retry:${event.properties.status.attempt}`, messageID: `retry:${event.properties.status.attempt}`,
}, },
]) || cancelled ]) || cancelled
) )
} }
@@ -853,13 +854,13 @@ export function reduceSubagentData(input: {
if (event.type === "session.error" && event.properties.error) { if (event.type === "session.error" && event.properties.error) {
return ( return (
appendCommits(detail, [ appendCommits(detail, [
{ {
kind: "error", kind: "error",
text: formatError(event.properties.error), text: formatError(event.properties.error),
phase: "start", phase: "start",
source: "system", source: "system",
messageID: `session.error:${event.properties.sessionID}:${formatError(event.properties.error)}`, messageID: `session.error:${event.properties.sessionID}:${formatError(event.properties.error)}`,
}, },
]) || cancelled ]) || cancelled
) )
} }

View File

@@ -102,63 +102,62 @@ function assistantMessage(
} }
} }
const provider = (name: string): RunProvider => const provider = (name: string): RunProvider => ({
({ id: "openai",
id: "openai", name: "OpenAI",
name: "OpenAI", source: "api",
source: "api", env: [],
env: [], options: {},
options: {}, models: {
models: { "gpt-5": {
"gpt-5": { id: "gpt-5",
id: "gpt-5", providerID: "openai",
providerID: "openai", api: {
api: { id: "openai",
id: "openai", url: "https://openai.test",
url: "https://openai.test", npm: "@ai-sdk/openai",
npm: "@ai-sdk/openai",
},
name,
capabilities: {
temperature: true,
reasoning: true,
attachment: true,
toolcall: true,
input: {
text: true,
audio: false,
image: false,
video: false,
pdf: false,
},
output: {
text: true,
audio: false,
image: false,
video: false,
pdf: false,
},
interleaved: false,
},
cost: {
input: 0,
output: 0,
cache: {
read: 0,
write: 0,
},
},
limit: {
context: 128000,
output: 8192,
},
status: "active",
options: {},
headers: {},
release_date: "2026-01-01",
}, },
name,
capabilities: {
temperature: true,
reasoning: true,
attachment: true,
toolcall: true,
input: {
text: true,
audio: false,
image: false,
video: false,
pdf: false,
},
output: {
text: true,
audio: false,
image: false,
video: false,
pdf: false,
},
interleaved: false,
},
cost: {
input: 0,
output: 0,
cache: {
read: 0,
write: 0,
},
},
limit: {
context: 128000,
output: 8192,
},
status: "active",
options: {},
headers: {},
release_date: "2026-01-01",
}, },
}) },
})
function runningToolMessage(id: string): SessionMessages[number] { function runningToolMessage(id: string): SessionMessages[number] {
return { return {

View File

@@ -461,7 +461,7 @@ export function Prompt(props: PromptProps) {
if (!virtualText) return part if (!virtualText) return part
const newStart = normalized.indexOf(virtualText) const newStart = normalized.indexOf(virtualText)
// if the virtual text is deleted, remove the part // if the virtual text is deleted, remove the part
if (newStart === -1) return null if (newStart === -1) return null
@@ -496,14 +496,14 @@ export function Prompt(props: PromptProps) {
}) })
.filter((part) => part !== null) .filter((part) => part !== null)
setStore("prompt", { setStore("prompt", {
input: normalized, input: normalized,
// keep only the non-text parts because the text parts were // keep only the non-text parts because the text parts were
// already expanded inline // already expanded inline
parts: updatedNonTextParts, parts: updatedNonTextParts,
}) })
restoreExtmarksFromParts(updatedNonTextParts) restoreExtmarksFromParts(updatedNonTextParts)
input.cursorOffset = Bun.stringWidth(normalized) input.cursorOffset = Bun.stringWidth(normalized)
}, },
}, },
{ {