Skip to content

Commit 3867fa2

Browse files
chore: generate
1 parent 07808be commit 3867fa2

12 files changed

Lines changed: 167 additions & 150 deletions

File tree

packages/opencode/src/cli/cmd/run/footer.command.tsx

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,14 @@ function PanelShell(props: {
298298
</box>
299299
)}
300300
{minimal() ? (
301-
<box id={`${props.id}-bottom`} width="100%" height={1} border={false} backgroundColor="transparent" flexShrink={0}>
301+
<box
302+
id={`${props.id}-bottom`}
303+
width="100%"
304+
height={1}
305+
border={false}
306+
backgroundColor="transparent"
307+
flexShrink={0}
308+
>
302309
<box
303310
width="100%"
304311
height={1}
@@ -368,17 +375,18 @@ export function RunCommandMenuBody(props: {
368375
},
369376
...(props.subagents().length > 0
370377
? [
371-
{
372-
action: "subagent" as const,
373-
category: "Session",
374-
display: "View subagents",
375-
footer: activeSubagentCount() > 0 ? `${activeSubagentCount()} active` : `${props.subagents().length} recent`,
376-
keywords: props
377-
.subagents()
378-
.map((item) => `${item.label} ${item.description} ${item.title ?? ""}`)
379-
.join(" "),
380-
},
381-
]
378+
{
379+
action: "subagent" as const,
380+
category: "Session",
381+
display: "View subagents",
382+
footer:
383+
activeSubagentCount() > 0 ? `${activeSubagentCount()} active` : `${props.subagents().length} recent`,
384+
keywords: props
385+
.subagents()
386+
.map((item) => `${item.label} ${item.description} ${item.title ?? ""}`)
387+
.join(" "),
388+
},
389+
]
382390
: []),
383391
{
384392
action: "slash",
@@ -392,16 +400,16 @@ export function RunCommandMenuBody(props: {
392400
const prompt: CommandEntry[] =
393401
props.commands() === undefined || skills().length > 0
394402
? [
395-
{
396-
action: "skill" as const,
397-
category: "Prompt",
398-
display: "Skills",
399-
footer: "/skills",
400-
keywords: `skill skills ${skills()
401-
.map((item) => `${item.name} ${item.description ?? ""}`)
402-
.join(" ")}`.trim(),
403-
},
404-
]
403+
{
404+
action: "skill" as const,
405+
category: "Prompt",
406+
display: "Skills",
407+
footer: "/skills",
408+
keywords: `skill skills ${skills()
409+
.map((item) => `${item.name} ${item.description ?? ""}`)
410+
.join(" ")}`.trim(),
411+
},
412+
]
405413
: []
406414
const agent: CommandEntry[] = [
407415
{
@@ -411,17 +419,17 @@ export function RunCommandMenuBody(props: {
411419
},
412420
...(props.queued().length > 0
413421
? [
414-
{
415-
action: "queued" as const,
416-
category: "Agent",
417-
display: "Manage queued prompts",
418-
footer: `${props.queued().length} queued`,
419-
keywords: props
420-
.queued()
421-
.map((item) => item.prompt.text)
422-
.join(" "),
423-
},
424-
]
422+
{
423+
action: "queued" as const,
424+
category: "Agent",
425+
display: "Manage queued prompts",
426+
footer: `${props.queued().length} queued`,
427+
keywords: props
428+
.queued()
429+
.map((item) => item.prompt.text)
430+
.join(" "),
431+
},
432+
]
425433
: []),
426434
{
427435
action: "variant.cycle",
@@ -432,13 +440,13 @@ export function RunCommandMenuBody(props: {
432440
},
433441
...(props.variants().length > 0
434442
? [
435-
{
436-
action: "variant.list" as const,
437-
category: "Agent",
438-
display: "Switch model variant",
439-
keywords: `variant variants ${props.variants().join(" ")}`,
440-
},
441-
]
443+
{
444+
action: "variant.list" as const,
445+
category: "Agent",
446+
display: "Switch model variant",
447+
keywords: `variant variants ${props.variants().join(" ")}`,
448+
},
449+
]
442450
: []),
443451
]
444452
const commands = (props.commands() ?? [])

packages/opencode/src/cli/cmd/run/footer.menu.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ export function RunFooterMenu(props: {
264264
if (row.type === "header") {
265265
return (
266266
<box paddingLeft={props.paddingLeft ?? 1} paddingRight={props.paddingRight ?? 1}>
267-
<text fg={props.headerColor ?? props.theme().highlight} attributes={TextAttributes.BOLD} wrapMode="none" truncate>
267+
<text
268+
fg={props.headerColor ?? props.theme().highlight}
269+
attributes={TextAttributes.BOLD}
270+
wrapMode="none"
271+
truncate
272+
>
268273
{row.label}
269274
</text>
270275
</box>
@@ -281,11 +286,7 @@ export function RunFooterMenu(props: {
281286
? props.theme().shade
282287
: transparent
283288
return (
284-
<box
285-
paddingRight={0}
286-
flexDirection="row"
287-
backgroundColor={background()}
288-
>
289+
<box paddingRight={0} flexDirection="row" backgroundColor={background()}>
289290
{border() ? (
290291
<text fg={props.theme().highlight} bg={background()} wrapMode="none">
291292
{active() ? "▌" : " "}

packages/opencode/src/cli/cmd/run/footer.prompt.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export function RunPromptBody(props: {
234234

235235
props.onContentChange()
236236
})
237-
.catch(() => { })
237+
.catch(() => {})
238238
}, 0)
239239
}
240240

@@ -1200,7 +1200,11 @@ export function createPromptState(input: PromptInput): PromptState {
12001200
return
12011201
}
12021202

1203-
const submit = command ? { ...next, command } : parsed?.type === "command" ? { ...next, command: parsed.command } : next
1203+
const submit = command
1204+
? { ...next, command }
1205+
: parsed?.type === "command"
1206+
? { ...next, command: parsed.command }
1207+
: next
12041208
const shellMode = next.mode === "shell"
12051209

12061210
resetDraft()

packages/opencode/src/cli/cmd/run/footer.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,14 @@ export class RunFooter implements FooterApi {
720720
: this.promptRoute.type === "model"
721721
? 1 + MODEL_ROWS
722722
: this.promptRoute.type === "variant"
723-
? 1 + VARIANT_ROWS
724-
: this.promptRoute.type === "queued-menu"
725-
? 1 + this.subagentMenuRows
726-
: this.promptRoute.type === "subagent-menu"
723+
? 1 + VARIANT_ROWS
724+
: this.promptRoute.type === "queued-menu"
727725
? 1 + this.subagentMenuRows
728-
: this.promptRoute.type === "subagent"
729-
? this.base + SUBAGENT_INSPECTOR_ROWS
730-
: this.base + Math.max(TEXTAREA_MIN_ROWS, Math.min(PROMPT_MAX_ROWS, this.rows))
726+
: this.promptRoute.type === "subagent-menu"
727+
? 1 + this.subagentMenuRows
728+
: this.promptRoute.type === "subagent"
729+
? this.base + SUBAGENT_INSPECTOR_ROWS
730+
: this.base + Math.max(TEXTAREA_MIN_ROWS, Math.min(PROMPT_MAX_ROWS, this.rows))
731731

732732
if (height !== this.renderer.footerHeight) {
733733
this.renderer.footerHeight = height

packages/opencode/src/cli/cmd/run/footer.view.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ export function RunFooterView(props: RunFooterViewProps) {
166166

167167
return tabs().findIndex((item) => item.sessionID === sessionID) + 1
168168
})
169-
const foregroundSubagents = createMemo(() => props.backgroundSubagents && activeTabs().some((item) => !item.background))
169+
const foregroundSubagents = createMemo(
170+
() => props.backgroundSubagents && activeTabs().some((item) => !item.background),
171+
)
170172
const model = createMemo(() => {
171173
const current = props.currentModel()
172174
return current ? modelInfo(props.providers(), current) : { model: props.state().model, provider: undefined }
@@ -648,9 +650,9 @@ export function RunFooterView(props: RunFooterViewProps) {
648650
panel() || prompt()
649651
? undefined
650652
: {
651-
...EMPTY_BORDER,
652-
vertical: "█",
653-
}
653+
...EMPTY_BORDER,
654+
vertical: "█",
655+
}
654656
}
655657
>
656658
<box
@@ -938,7 +940,9 @@ export function RunFooterView(props: RunFooterViewProps) {
938940
maxWidth={18}
939941
>
940942
<text fg={theme().text} wrapMode="none" truncate>
941-
<Show when={hasActivityMeta() || hasModelStatus() || hasContextHints()}>{sectionSeparator()}</Show>
943+
<Show when={hasActivityMeta() || hasModelStatus() || hasContextHints()}>
944+
{sectionSeparator()}
945+
</Show>
942946
<span style={{ fg: theme().text }}>{hint().key}</span>{" "}
943947
<span style={{ fg: theme().muted }}>{hint().label}</span>
944948
</text>

packages/opencode/src/cli/cmd/run/prompt.editor.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,7 @@ function promptPartStart(part: Mention) {
9696
return part.source?.text.start ?? Number.POSITIVE_INFINITY
9797
}
9898

99-
function findPromptPartIndex(
100-
content: string,
101-
text: string,
102-
used: Array<{ start: number; end: number }>,
103-
hint: number,
104-
) {
99+
function findPromptPartIndex(content: string, text: string, used: Array<{ start: number; end: number }>, hint: number) {
105100
let searchFrom = 0
106101
let best = -1
107102
let distance = Number.POSITIVE_INFINITY

packages/opencode/src/cli/cmd/run/scrollback.writer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ export function turnSummaryWriter(input: { agent: string; model: string; duratio
341341
<text wrapMode="none" truncate>
342342
<span style={{ fg: input.theme.block.highlight }}></span>
343343
<span style={{ fg: input.theme.block.text }}>{input.agent}</span>
344-
<span style={{ fg: input.theme.block.muted }}> · {input.model} · {input.duration}</span>
344+
<span style={{ fg: input.theme.block.muted }}>
345+
{" "}
346+
· {input.model} · {input.duration}
347+
</span>
345348
</text>
346349
</box>
347350
),

packages/opencode/src/cli/cmd/run/session-replay.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ function replayMessage(
217217
commits.push(...next.commits)
218218
}
219219

220-
const summary = config.summaries.has(message.info.id) ? messageTurnSummaryCommit(message, config.providers) : undefined
220+
const summary = config.summaries.has(message.info.id)
221+
? messageTurnSummaryCommit(message, config.providers)
222+
: undefined
221223
if (summary) {
222224
commits.push(summary)
223225
}

packages/opencode/src/cli/cmd/run/stream.transport.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,10 @@ function createLayer(input: StreamInput) {
713713
messages: messagesList,
714714
permissions: sessionPermissions,
715715
questions: sessionQuestions,
716-
thinking: input.thinking,
717-
limits: input.limits(),
718-
providers: input.providers?.(),
719-
})
716+
thinking: input.thinking,
717+
limits: input.limits(),
718+
providers: input.providers?.(),
719+
})
720720
: undefined
721721
const replay =
722722
history && input.replayLimit !== undefined && messagesList.length > input.replayLimit

packages/opencode/src/cli/cmd/run/subagent-data.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -829,37 +829,38 @@ export function reduceSubagentData(input: {
829829
}
830830

831831
const detail = ensureDetail(input.data, sessionID)
832-
const cancelled = event.type === "message.updated" && isAbortedAssistantMessage(event.properties.info)
833-
? cancelSubagentTab(input.data, sessionID)
834-
: false
832+
const cancelled =
833+
event.type === "message.updated" && isAbortedAssistantMessage(event.properties.info)
834+
? cancelSubagentTab(input.data, sessionID)
835+
: false
835836
if (event.type === "session.status") {
836837
if (event.properties.status.type !== "retry") {
837838
return cancelled
838839
}
839840

840841
return (
841842
appendCommits(detail, [
842-
{
843-
kind: "error",
844-
text: event.properties.status.message,
845-
phase: "start",
846-
source: "system",
847-
messageID: `retry:${event.properties.status.attempt}`,
848-
},
843+
{
844+
kind: "error",
845+
text: event.properties.status.message,
846+
phase: "start",
847+
source: "system",
848+
messageID: `retry:${event.properties.status.attempt}`,
849+
},
849850
]) || cancelled
850851
)
851852
}
852853

853854
if (event.type === "session.error" && event.properties.error) {
854855
return (
855856
appendCommits(detail, [
856-
{
857-
kind: "error",
858-
text: formatError(event.properties.error),
859-
phase: "start",
860-
source: "system",
861-
messageID: `session.error:${event.properties.sessionID}:${formatError(event.properties.error)}`,
862-
},
857+
{
858+
kind: "error",
859+
text: formatError(event.properties.error),
860+
phase: "start",
861+
source: "system",
862+
messageID: `session.error:${event.properties.sessionID}:${formatError(event.properties.error)}`,
863+
},
863864
]) || cancelled
864865
)
865866
}

0 commit comments

Comments
 (0)