mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
sync
This commit is contained in:
parent
2e0e72c4df
commit
95f5bdf6bf
3 changed files with 16 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ import {
|
|||
fg,
|
||||
type KeyBinding,
|
||||
} from "@opentui/core"
|
||||
import { createEffect, createMemo, Match, Switch, type JSX, onMount, batch } from "solid-js"
|
||||
import { createEffect, createMemo, Match, Switch, type JSX, onMount } from "solid-js"
|
||||
import { useLocal } from "@tui/context/local"
|
||||
import { useTheme } from "@tui/context/theme"
|
||||
import { SplitBorder } from "@tui/component/border"
|
||||
|
|
@ -425,7 +425,10 @@ export function Prompt(props: PromptProps) {
|
|||
},
|
||||
body: {
|
||||
agent: local.agent.current().name,
|
||||
model: `${local.model.current().providerID}/${local.model.current().modelID}`,
|
||||
model: {
|
||||
providerID: local.model.current().providerID,
|
||||
modelID: local.model.current().modelID,
|
||||
},
|
||||
command: inputText,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1085,6 +1085,12 @@ export namespace SessionPrompt {
|
|||
export const ShellInput = z.object({
|
||||
sessionID: Identifier.schema("session"),
|
||||
agent: z.string(),
|
||||
model: z
|
||||
.object({
|
||||
providerID: z.string(),
|
||||
modelID: z.string(),
|
||||
})
|
||||
.optional(),
|
||||
command: z.string(),
|
||||
})
|
||||
export type ShellInput = z.infer<typeof ShellInput>
|
||||
|
|
@ -1094,7 +1100,7 @@ export namespace SessionPrompt {
|
|||
SessionRevert.cleanup(session)
|
||||
}
|
||||
const agent = await Agent.get(input.agent)
|
||||
const model = agent.model ?? (await lastModel(input.sessionID))
|
||||
const model = input.model ?? agent.model ?? (await lastModel(input.sessionID))
|
||||
const userMsg: MessageV2.User = {
|
||||
id: Identifier.ascending("message"),
|
||||
sessionID: input.sessionID,
|
||||
|
|
|
|||
|
|
@ -2294,6 +2294,10 @@ export type SessionCommandResponse = SessionCommandResponses[keyof SessionComman
|
|||
export type SessionShellData = {
|
||||
body?: {
|
||||
agent: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
command: string
|
||||
}
|
||||
path: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue